CVE-2025-40090

Source
https://cve.org/CVERecord?id=CVE-2025-40090
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40090.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-40090
Downstream
Published
2025-10-30T09:47:58.611Z
Modified
2026-02-06T22:12:30.552537Z
Summary
ksmbd: fix recursive locking in RPC handle list access
Details

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"), ksmbdsessionrpcmethod() attempts to lock sess->rpclock.

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/hungtasktimeoutsecs" disables this message. task:kworker/0:0 state:D stack:0 pid:5021 tgid:5021 ppid:2 flags:0x00200000 Workqueue: ksmbd-io handleksmbdwork Call trace: _schedule from schedule+0x3c/0x58 schedule from schedulepreemptdisabled+0xc/0x10 schedulepreemptdisabled from rwsemdownreadslowpath+0x1b0/0x1d8 rwsemdownreadslowpath from downread+0x28/0x30 downread from ksmbdsessionrpcmethod+0x18/0x3c ksmbdsessionrpcmethod from ksmbdrpcopen+0x34/0x68 ksmbdrpcopen from ksmbdsessionrpcopen+0x194/0x228 ksmbdsessionrpcopen from createsmb2pipe+0x8c/0x2c8 createsmb2pipe from smb2open+0x10c/0x27ac smb2open from handleksmbdwork+0x238/0x3dc handleksmbdwork from processscheduledworks+0x160/0x25c processscheduledworks from workerthread+0x16c/0x1e8 workerthread from kthread+0xa8/0xb8 kthread from retfromfork+0x14/0x38 Exception stack(0x8529ffb0 to 0x8529fff8)

The task deadlocks because the lock is already held: ksmbdsessionrpcopen downwrite(&sess->rpclock) ksmbdrpcopen ksmbdsessionrpcmethod downread(&sess->rpclock) <-- deadlock

Adjust ksmbdsessionrpc_method() callers to take the lock when necessary.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40090.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
69674b029002b1d90b655f014bdf64f404efa54d
Fixed
5493571f4351f74e11db9943e98a07c56467cf7e
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
6b615a8fb3af0baf8126cde3d4fee97d57222ffc
Fixed
1891abe832cbf5a11039e088766131d0f1642d02
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5cc679ba0f4505936124cd4179ba66bb0a4bd9f3
Fixed
4602b8cee1481dbb896182e5cb1e8cf12910e9e7
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
6bd7e0e55dcea2cf0d391bbc21c2eb069b4be3e1
Fixed
3412fbd81b46b9cfae013817b61d4bbd27e09e36
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
305853cce379407090a73b38c5de5ba748893aee
Fixed
88f170814fea74911ceab798a43cbd7c5599bed4

Affected versions

v6.*
v6.12.53
v6.12.54
v6.17.3
v6.17.4
v6.18-rc1

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40090.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.12.53
Fixed
6.12.55
Type
ECOSYSTEM
Events
Introduced
6.17.3
Fixed
6.17.5

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40090.json"