Bug 26097 - Support calling time functions (localtime, ctime etc.) after multi-threaded fork
Summary: Support calling time functions (localtime, ctime etc.) after multi-threaded fork
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: time (show other bugs)
Version: unspecified
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-09 11:41 UTC by Florian Weimer
Modified: 2020-06-09 11:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Weimer 2020-06-09 11:41:17 UTC
The current implementation based on locks can deadlock in the child process if fork and any of the time functions are called concurrently in a multi-threaded process.

This is not a bug in glibc because POSIX makes this behavior undefined, but it would be convenient to support this as an extension. A solution for bug 16145 cold probably help here as well.