Bug 20483 - incorrect double-checked locking in __nss_database_lookup
Summary: incorrect double-checked locking in __nss_database_lookup
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: nss (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-17 20:40 UTC by Torvald Riegel
Modified: 2016-08-18 08:35 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 Torvald Riegel 2016-08-17 20:40:08 UTC
__nss_database_lookup and its callers incorrectly implement double-checked locking.  There are data races and missing barriers.
Comment 1 Florian Weimer 2016-08-18 08:35:00 UTC
I expect the correct fix is to remove the outer check and call __nss_database_lookup unconditionally.  We can then implement correct double-checked locking within __nss_database_lookup, as a future optimization.

I assume this is difficult to hit in practice (due to the limited number of chances per process), so I'm flagging this as security-.