This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug time/21229] New: strftime race conditions related to data filled by tzset


https://sourceware.org/bugzilla/show_bug.cgi?id=21229

            Bug ID: 21229
           Summary: strftime race conditions related to data filled by
                    tzset
           Product: glibc
           Version: 2.25
            Status: NEW
          Severity: normal
          Priority: P2
         Component: time
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---

strftime calls tzset and then accesses __tzname and calls mktime.  These
accesses do not happen under the lock which protects the global timezone
variables, so there is a data race and strftime could use unexpected timezone
data.

It is unclear if POSIX actually requires that strftime calls tzset.  POSIX
says, “Local timezone information is used as though strftime() called tzset().”
 If the intent is that strftime has the same side effect as calling tzset
directly, updating the tzname, daylight, timezone variables, this is a curious
way of putting it, although the same language is used for localtime.

Furthermore, with our current tzset implementation, a call to tzset means that
we have to access the file system on every call, to check if the timezone data
file hasn't changed (if such a file is used).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]