CVE-2025-40090: ksmbd: fix recursive locking in RPC handle list access
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.
Security readout for executives and security teams
Plain-English summary
A remote client can trigger a locking deadlock in the Linux kernel’s ksmbd SMB server when opening a named pipe. Affected connections or kernel worker tasks may hang, disrupting file-sharing availability. The supplied CVSS score is 7.5 because the issue is network-reachable, requires no privileges or user interaction, and primarily affects availability.
Executive priority
Prioritize internet-facing or broadly reachable ksmbd servers because unauthenticated clients may disrupt availability. Patch them promptly through supported distribution channels. Systems not running ksmbd are unlikely to be exposed. Treat observed hangs as operationally significant, but the supplied evidence does not support confidentiality, integrity, or code-execution impact.
Technical view
ksmbd_session_rpc_open() holds sess->rpc_lock for writing and calls ksmbd_rpc_open(), which reaches ksmbd_session_rpc_method() and attempts a read lock on the same object. This recursive locking deadlocks the worker handling the SMB request. The upstream resolution changes callers so they acquire the lock only when necessary.
Likely exposure
Exposure is limited to Linux systems running ksmbd with SMB reachable by untrusted clients and a kernel containing the vulnerable locking change. The bundle lists relevant commit identifiers and fixed versions 6.12.53 and 6.17.3, but does not provide complete distribution package mappings. Confirm applicability with each Linux distributor.
Exploitation context
The supplied CVSS vector indicates remote, unauthenticated, low-complexity availability impact. The bundle demonstrates reproducible connection and worker hangs, but provides no evidence of data disclosure, modification, code execution, or exploitation in the wild. CVE-2025-40090 is not listed as KEV in the supplied data.
Researcher notes
The regression follows commit 305853cce379, which added locking inside ksmbd_session_rpc_method(). The deadlock path nests down_read() beneath an existing down_write() on sess->rpc_lock. Five stable-kernel fix references are supplied. Exact vulnerable release ranges and downstream backports remain incomplete, so commit or vendor-package analysis is required.
Mitigation direction
Update to a vendor-supported kernel containing the applicable upstream fix.
Confirm the distributor’s advisory maps the installed kernel package to the fixed commits.
Restrict SMB access to trusted networks while updates are pending.
Disable ksmbd where SMB service is unnecessary, following vendor operational guidance.
Validation and detection
Determine whether ksmbd is enabled and serving SMB connections.
Record the running kernel and distribution package versions.
Compare the package against distributor guidance and the referenced stable fixes.
Review logs and task diagnostics for hung ksmbd workers or named-pipe connection stalls.
After updating, confirm normal named-pipe operations without connection or worker hangs.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
description · low confidence lookup
Credential and access behavior lookup
The CVE wording references authentication or credential exposure, so valid-account and credential-access review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
6Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.