1605
Relevant to the view "Software Development" (CWE-699)
Nature Type ID Name Page
MemberOf 411 Resource Locking Problems 2325
Common Consequences
Scope Impact Likelihood
Availability
Integrity
DoS: Resource Consumption (CPU)
DoS: Crash, Exit, or Restart
Unexpected State
Potential Mitigations
Phase: Implementation
When locking and unlocking a resource, try to be sure that all control paths through the code in
which the resource is locked one or more times correspond to exactly as many unlocks. If the
software acquires a lock and then determines it is not able to perform its intended behavior, be
sure to release the lock(s) before waiting for conditions to improve. Reacquire the lock(s) before
trying again.
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 987 SFP Secondary Cluster: Multiple Locks/Unlocks 888 2412
MemberOf 1401 Comprehensive Categorization: Concurrency 1400 2526
Notes
Maintenance
An alternate way to think about this weakness is as an imbalance between the number of locks /
unlocks in the control flow. Over the course of execution, if each lock call is not followed by a
subsequent call to unlock in a reasonable amount of time, then system performance may be
degraded or at least operating at less than peak levels if there is competition for the locks. This
entry may need to be modified to reflect these concepts in the future.
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
Software Fault Patterns SFP21 Multiple locks/unlocks
CWE-765: Multiple Unlocks of a Critical Resource
Weakness ID : 765
Structure : Simple
Abstraction : Base
Description
The product unlocks a critical resource more times than intended, leading to an unexpected state in
the system.
Extended Description
When the product is operating in a concurrent environment and repeatedly unlocks a critical
resource, the consequences will vary based on the type of lock, the lock's implementation, and
the resource being protected. In some situations such as with semaphores, the resources are
CWE Version 4.14
CWE-765: Multiple Unlocks of a Critical Resource
CWE-765: Multiple Unlocks of a Critical Resource