Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: REM Cost Reform

...

Deadlock prevents multiple threads from progressing, thus halting the executing program. A denial-of-service attack is possible because the attacker can force deadlock situations. Deadlock is likely to occur in multithreaded programs that manage multiple shared resources.

Recommendation

Severity

Likelihood

Remediation Cost

Detectable

Repairable

Priority

Level

POS51-C

Low

Probable

Medium

No

No

P4

P2

L3

Automated Detection

ToolVersionCheckerDescription
Astrée
Include Page
Astrée_V
Astrée_V

Supported: Astrée reports all potential deadlocks.
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
CONCURRENCY.LOCK.ORDERConflicting
Lock Order

Related Guidelines

lock order
Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

C1772, C1773
Klocwork
Include Page
Klocwork_V
Klocwork_V

CONC.DL
CONC.NO_UNLOCK


Parasoft C/C++test

Include Page
Parasoft_V
Parasoft_V

CERT_C-POS51-a

Do not acquire locks in different order

Polyspace Bug Finder

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

CERT C: Rule POS51-C

Checks for deadlock (rule fully covered)

Related Guidelines

Key here (explains table format and definitions)

Taxonomy

Taxonomy item

Relationship

CERT C
CERT Oracle Coding Standard for Java
LCK07-J. Avoid deadlock by requesting and releasing locks in the same order
MITRE CWE
Prior to 2018-01-12: CERT: Unspecified Relationship

CERT-CWE Mapping Notes

Key here for mapping notes

CWE-764 and POS51-C/POS35-C

Independent( CWE-764, POS51-C, POS35-C)

CWE-764

...

is about semaphores, or objects capable of being locked multiple times. Deadlock arises from multiple locks being acquired in a cyclic order, and generally does not arise from semaphores or recursive mutexes.

Bibliography

[Barney 2010]pthread_mutex tutorial
[Bryant 2003]Chapter 13, "Concurrent Programming"

...


...

Image Modified Image Modified Image Modified