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 libc/11449] New: crypt/crypt_util.c: __init_des_r() needs memory barrier


The small_tables_initialized variable is checked prior to acquiring the lock
(for speed), yet it is set before the lock is released.  The problem is that
there's no memory barrier (neither compiler nor hardware, where applicable)
after the initializations of other variables and until the initialized flag is
set.  The volatile keyword on the flag variable does not prevent its write from
being re-ordered with writes to non-volatile variables.

To fix this, I propose to add atomic_write_barrier() before setting the flag.

-- 
           Summary: crypt/crypt_util.c: __init_des_r() needs memory barrier
           Product: glibc
           Version: 2.11
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: solar at openwall dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11449

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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