Skip to content
Race condition Disclosed report CVE-2016-1975

Potential race conditions around block-level statics cause memory-safety bugs

q1 Follow

Originally disclosed on Mozilla

  • Fixed in 2 months
  • Paid in 2 months
  • Disclosed after 2 months
Text
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;

The original report as published on Mozilla's Bugzilla, by q1. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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.

More by q1

View all

71 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.