---
title: "CWE-764: Multiple Locks of a Critical Resource"
url: https://radicalnotion.ai/cwe/cwe-764
type: cwe
description: "The product locks a critical resource more times than intended, leading to an unexpected state in the system."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-764: Multiple Locks of a Critical Resource

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 13
- **Of those, in CISA KEV:** 0
- **New in 2026:** 8
- **CWE catalog version:** 4.21

## Description

The product locks a critical resource more times than intended, leading to an unexpected state in the system.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Availability, Integrity | DoS: Resource Consumption (CPU), DoS: Crash, Exit, or Restart, Unexpected State | When a product is operating in a concurrent environment and repeatedly locks 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 pooled and extra locking calls will reduce the size of the total available pool, possibly leading to degraded performance or a denial of service. If this can be triggered by an attacker, it will be similar to an unrestricted lock (CWE-412). In the context of a binary lock, it is likely that any duplicate locking attempts will never succeed, since the lock is already held and progress may not be possible. |

## Potential mitigations

### 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.

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Effectiveness: High

## Real CVEs with this weakness (sample of 12 of 13)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2025-40347 | net: enetc: fix the deadlock of enetc\_mdio\_lock | high | 7.5 | - | No | 2025-12-16 |
| CVE-2025-37917 | net: ethernet: mtk-star-emac: fix spinlock recursion issues on rx/tx poll | high | 7.5 | - | No | 2025-05-20 |
| CVE-2026-93202 | i3c: master: Fix recursive locking during device registration | medium | 5.5 | - | No | 2026-09-17 |
| CVE-2026-90342 | bpf: Fix mmap\_lock deadlock on arena lock failure | medium | 5.5 | - | No | 2026-09-17 |
| CVE-2026-90247 | bpf: Fix mmap\_lock leak in irq\_work path | medium | 5.5 | - | No | 2026-09-17 |
| CVE-2026-90238 | media: amd: isp4: fix self-deadlock in isp4sd\_pwron\_and\_init() error path | medium | 5.5 | - | No | 2026-09-17 |
| CVE-2026-80535 | xfs: don't double-lock when deleting a self-referential directory | medium | 5.5 | - | No | 2026-08-26 |
| CVE-2022-50648 | ftrace: Fix recursive locking direct\_mutex in ftrace\_modify\_direct\_caller | medium | 5.5 | - | No | 2025-12-09 |
| CVE-2024-43834 | xdp: fix invalid wait context of page\_pool\_destroy() | medium | 5.5 | - | No | 2024-08-17 |
| CVE-2024-35934 | net/smc: reduce rtnl pressure in smc\_pnet\_create\_pnetids\_list() | medium | 5.5 | - | No | 2024-05-19 |
| CVE-2026-97948 | powerpc/eeh: Fix recursive locking on devices without EEH sensitive driver | medium | 4.7 | - | No | 2026-09-25 |
| CVE-2026-99048 | gve: fix napi\_disable deadlock when attempting to disable XSK pools | medium | 4.4 | - | No | 2026-10-23 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-662](https://radicalnotion.ai/cwe/cwe-662) | Improper Synchronization |
| Parent | [CWE-667](https://radicalnotion.ai/cwe/cwe-667) | Improper Locking |
| Parent | [CWE-675](https://radicalnotion.ai/cwe/cwe-675) | Multiple Operations on Resource in Single-Operation Context |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| Software Fault Patterns | Multiple locks/unlocks | SFP21 | - |

## Frequently asked questions

### What is CWE-764?

The product locks a critical resource more times than intended, leading to an unexpected state in the system.

### What CVEs are caused by CWE-764?

13 recorded CVEs are attributed to CWE-764, including CVE-2025-40347, CVE-2025-37917 and CVE-2026-93202.

### How do you prevent CWE-764?

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.

### How is CWE-764 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-764?

Exploiting CWE-764 can lead to: DoS: Resource Consumption (CPU), DoS: Crash, Exit, or Restart, Unexpected State.

### Is CWE-764 actively exploited?

13 recorded CVEs are caused by CWE-764; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/764.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-764). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
