
When multiple threads can read or modify the same data, use synchronization techniques to avoid software flaws that can lead to security vulnerabilities. Data races can often result in abnormal termination or denial of service, but it is possible for them to result in more serious vulnerabilities. The C Standard, section 5.1.2.45, paragraph 25 35 [ISO/IEC 9899:20112024], says:
The execution of a program contains a data race if it contains two conflicting actions in different threads, at least one of which is not atomic, and neither happens before the other. Any such data race results in undefined behavior.
...
Taxonomy | Taxonomy item | Relationship |
---|---|---|
CWE 2.11 | CWE-366, Race condition within a thread | 2017-07-07: CERT: Exact |
Bibliography
[ISO/IEC 9899:20112024] | 5.1.2.45, "Multi-threaded Executions and Data Races" 7.17.2, "Initialization" |
[C99 Rationale 2003] | |
[Dowd 2006] | Chapter 13, "Synchronization and State" |
[Plum 2012] | |
[Seacord 2013] | Chapter 8, "File I/O" |
...