# CVE-2025-40090: ksmbd: fix recursive locking in RPC handle list access

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.53% (percentile 38, 2026-11-26)
- **CWE:** CWE-674
- **Published:** 2025-10-30T09:47:58.611Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= 69674b029002b1d90b655f014bdf64f404efa54d, \< 5493571f4351f74e11db9943e98a07c56467cf7e; \>= 6b615a8fb3af0baf8126cde3d4fee97d57222ffc, \< 1891abe832cbf5a11039e088766131d0f1642d02; \>= 5cc679ba0f4505936124cd4179ba66bb0a4bd9f3, \< 4602b8cee1481dbb896182e5cb1e8cf12910e9e7; \>= 6bd7e0e55dcea2cf0d391bbc21c2eb069b4be3e1, \< 3412fbd81b46b9cfae013817b61d4bbd27e09e36; \>= 305853cce379407090a73b38c5de5ba748893aee, \< 88f170814fea74911ceab798a43cbd7c5599bed4
- Anyone running Linux \>= 6.12.53, \< 6.12.55; \>= 6.17.3, \< 6.17.5

## Description

In the Linux kernel, the following vulnerability has been resolved:

ksmbd: fix recursive locking in RPC handle list access

Since commit 305853cce3794 ("ksmbd: Fix race condition in RPC handle list
access"), ksmbd\_session\_rpc\_method() attempts to lock sess-\>rpc\_lock.

This causes hung connections / tasks when a client attempts to open
a named pipe. Using Samba's rpcclient tool:

 $ rpcclient //192.168.1.254 -U user%password
 $ rpcclient $\> srvinfo
 \<connection hung here\>

Kernel side:
  "echo 0 \> /proc/sys/kernel/hung\_task\_timeout\_secs" disables this message.
  task:kworker/0:0 state:D stack:0 pid:5021 tgid:5021 ppid:2 flags:0x00200000
  Workqueue: ksmbd-io handle\_ksmbd\_work
  Call trace:
  \_\_schedule from schedule+0x3c/0x58
  schedule from schedule\_preempt\_disabled+0xc/0x10
  schedule\_preempt\_disabled from rwsem\_down\_read\_slowpath+0x1b0/0x1d8
  rwsem\_down\_read\_slowpath from down\_read+0x28/0x30
  down\_read from ksmbd\_session\_rpc\_method+0x18/0x3c
  ksmbd\_session\_rpc\_method from ksmbd\_rpc\_open+0x34/0x68
  ksmbd\_rpc\_open from ksmbd\_session\_rpc\_open+0x194/0x228
  ksmbd\_session\_rpc\_open from create\_smb2\_pipe+0x8c/0x2c8
  create\_smb2\_pipe from smb2\_open+0x10c/0x27ac
  smb2\_open from handle\_ksmbd\_work+0x238/0x3dc
  handle\_ksmbd\_work from process\_scheduled\_works+0x160/0x25c
  process\_scheduled\_works from worker\_thread+0x16c/0x1e8
  worker\_thread from kthread+0xa8/0xb8
  kthread from ret\_from\_fork+0x14/0x38
  Exception stack(0x8529ffb0 to 0x8529fff8)

The task deadlocks because the lock is already held:
  ksmbd\_session\_rpc\_open
    down\_write(&sess-\>rpc\_lock)
    ksmbd\_rpc\_open
      ksmbd\_session\_rpc\_method
        down\_read(&sess-\>rpc\_lock)   \<-- deadlock

Adjust ksmbd\_session\_rpc\_method() callers to take the lock when necessary.

## Affected and fixed versions

- Linux: \>= 69674b029002b1d90b655f014bdf64f404efa54d, \< 5493571f4351f74e11db9943e98a07c56467cf7e; \>= 6b615a8fb3af0baf8126cde3d4fee97d57222ffc, \< 1891abe832cbf5a11039e088766131d0f1642d02; \>= 5cc679ba0f4505936124cd4179ba66bb0a4bd9f3, \< 4602b8cee1481dbb896182e5cb1e8cf12910e9e7; \>= 6bd7e0e55dcea2cf0d391bbc21c2eb069b4be3e1, \< 3412fbd81b46b9cfae013817b61d4bbd27e09e36; \>= 305853cce379407090a73b38c5de5ba748893aee, \< 88f170814fea74911ceab798a43cbd7c5599bed4 (cvelist)
- Linux: \>= 6.12.53, \< 6.12.55; \>= 6.17.3, \< 6.17.5 (cvelist)

## Mitigation

- Upgrade Linux to 88f170814fea74911ceab798a43cbd7c5599bed4 or later.
- Upgrade Linux to 6.17.5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-40090. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40090.md
Affected: Linux >= 69674b029002b1d90b655f014bdf64f404efa54d, < 5493571f4351f74e11db9943e98a07c56467cf7e; >= 6b615a8fb3af0baf8126cde3d4fee97d57222ffc, < 1891abe832cbf5a11039e088766131d0f1642d02; >= 5cc679ba0f4505936124cd4179ba66bb0a4bd9f3, < 4602b8cee1481dbb896182e5cb1e8cf12910e9e7; >= 6bd7e0e55dcea2cf0d391bb…
Fixed in: Linux 5493571f4351f74e11db9943e98a07c56467cf7e, Linux 1891abe832cbf5a11039e088766131d0f1642d02, Linux 4602b8cee1481dbb896182e5cb1e8cf12910e9e7, Linux 3412fbd81b46b9cfae013817b61d4bbd27e09e36, Linux 88f170814fea74911ceab798a43cbd7c5599bed4, Linux 6.12.55, Linux 6.17.5

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-40090 being exploited?

There is no confirmed exploitation: CVE-2025-40090 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.53% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-40090?

High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2025-40090?

Linux \>= 69674b029002b1d90b655f014bdf64f404efa54d, \< 5493571f4351f74e11db9943e98a07c56467cf7e; \>= 6b615a8fb3af0baf8126cde3d4fee97d57222ffc, \< 1891abe832cbf5a11039e088766131d0f1642d02; \>= 5cc679ba0f4505936124cd4179ba66bb0a4bd9f3, \< 4602b8cee1481dbb896182e5cb1e8cf12910e9e7; \>= 6bd7e0e55dcea2cf0d391bbc21c2eb069b4be3e1, \< 3412fbd81b46b9cfae013817b61d4bbd27e09e36; \>= 305853cce379407090a73b38c5de5ba748893aee, \< 88f170814fea74911ceab798a43cbd7c5599bed4; Linux \>= 6.12.53, \< 6.12.55; \>= 6.17.3, \< 6.17.5.

### Is there a fix for CVE-2025-40090?

Yes. Fixed in Linux 5493571f4351f74e11db9943e98a07c56467cf7e, Linux 1891abe832cbf5a11039e088766131d0f1642d02, Linux 4602b8cee1481dbb896182e5cb1e8cf12910e9e7, Linux 3412fbd81b46b9cfae013817b61d4bbd27e09e36, Linux 88f170814fea74911ceab798a43cbd7c5599bed4, Linux 6.12.55, Linux 6.17.5. Upgrade Linux to 88f170814fea74911ceab798a43cbd7c5599bed4 or later. Upgrade Linux to 6.17.5 or later.

### How do I check if I'm affected by CVE-2025-40090?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/5493571f4351f74e11db9943e98a07c56467cf7e>
- patch: <https://git.kernel.org/stable/c/1891abe832cbf5a11039e088766131d0f1642d02>
- patch: <https://git.kernel.org/stable/c/4602b8cee1481dbb896182e5cb1e8cf12910e9e7>
- patch: <https://git.kernel.org/stable/c/3412fbd81b46b9cfae013817b61d4bbd27e09e36>
- patch: <https://git.kernel.org/stable/c/88f170814fea74911ceab798a43cbd7c5599bed4>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-40090>

HTML: <https://flawdb.com/CVE-2025-40090> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-40090>
