This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/11449] New: crypt/crypt_util.c: __init_des_r() needs memory barrier
- From: "solar at openwall dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 29 Mar 2010 20:45:12 -0000
- Subject: [Bug libc/11449] New: crypt/crypt_util.c: __init_des_r() needs memory barrier
- Reply-to: sourceware-bugzilla at sourceware dot org
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.