Potential race conditions around block-level statics cause memory-safety bugs
- Fixed in 2 months
- Paid in 2 months
- Disclosed after 2 months
The codebase contains many instances of code like this:
static CC* CC::GetInstance () {
static CC theInstance;
return &theInstance;
}
This pattern is not thread-safe under compilers lacking C++11 compliance, in particular compliance with s.6.7(4). Concurrent execution of such code could cause use of incompletely-initialized, partially-deleted, or otherwise broken objects, depending upon how CC is implemented and the exact timing of the racing threads. Since (at least) VS < VS 2015 is non-compliant, this issue potentially affects the Mozilla codebase.
The discussion at https://bugzilla.mozilla.org/show_bug.cgi?id=1218124#c11 and following comments describes the problem in detail. Also, you easily can see the problem by examining the code that, e.g., VS 2012 generates for:
static CC* CC::GetInstance () {
static CC theInstance;
return &theInstance;
}
which is similar to:
/* module-level hidden variable */ static bool is_CC_theInstance_initialized;
if (!is_CC_theInstance_initialized) {
is_CC_theInstance_initialized = true;
::new (&theInstance) CC;
}
return &theInstance;
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity race condition bug in WebRTC: Audio/Video. Mozilla made it public on 12 February 2016 as CVE-2016-1975.
About Race condition
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.