...
Threads that reference the stack of other threads can potentially overwrite important information on the stack, such as function pointers and return addresses. However, it would be difficult for an attacker to exploit this code from this error alone. The compiler will not generate warnings if the programmer decides to give another thread access to one thread's local variables, so a programmer may not catch a potential error at compile time. The remediation cost for this error is high because analysis tools have difficulty diagnosing problems with concurrency and race conditions.
Recommendation | Severity | Likelihood |
|---|
Remediation Cost
Priority
Level
POS50-C
Medium
Probable
High
P4
Detectable | Repairable | Priority | Level | |||
|---|---|---|---|---|---|---|
POS50-C | Medium | Probable | No | No | P4 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Helix QAC |
| DF4926, DF4927, DF4928 | |||||||
| Parasoft C/C++test |
| CERT_C-POS50-a | Declare objects shared between POSIX threads with appropriate storage durations | ||||||
| Polyspace Bug Finder |
| CERT C: Rule POS50-C | Checks for automatic or thread local variable escaping from a POSIX thread (rule fully covered) |
Bibliography
| [Bryant 2003] | Chapter 13, "Concurrent Programming" |
| [OpenMP] |
...
...