CVE-2026-139229: ksmbd: reject foreign RPC pipe handles on IPC$ read and write
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: reject foreign RPC pipe handles on IPC$ read and write
RPC pipe handles on IPC$ are allocated from a single server-global IDA, and ksmbd.mountd looks a pipe up by handle alone, with no session information. smb2readpipe() and smb2writepipe() take the handle straight from the client request (VolatileFileId) and pass it to the daemon without checking that the requesting session opened it. An authenticated user can therefore issue an SMB2 READ or WRITE on IPC$ with another session's handle and receive that session's in-flight DCERPC response, or write attacker-chosen bytes into its pipe stream. A tree connect to IPC$, which every RPC client already has, is the only requirement.
Validate ownership before the transfer, the way the sibling pipe paths already do: under sess->rpclock, ksmbdsessionrpcmethod() returns 0 for a handle the session did not open. smb2getinfofilepipe() and the FSCTLPIPETRANSCEIVE ioctl already reject such handles; read and write were the remaining gap. Reject them with STATUSFILECLOSED, as the ioctl path does.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.119 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.65 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6 - Compensating control
In ksmbd, validate RPC pipe handle ownership under sess->rpc_lock before SMB2 reads or writes; reject handles not opened by the requesting session with STATUS_FILE_CLOSED.
Event History
Frequently Asked Questions
Who can exploit this issue?
An authenticated SMB user can exploit it. The user needs a tree connection to IPC$, which every RPC client already has.
What could an attacker do with another session's pipe handle?
They can issue SMB2 READ requests to receive another session's in-flight DCERPC response, or SMB2 WRITE requests to inject attacker-chosen bytes into that session's pipe stream.
Which operations were missing the ownership check?
The missing validation affected IPC$ pipe reads and writes through smb2_read_pipe() and smb2_write_pipe(). Other paths, including file-pipe get-info and FSCTL_PIPE_TRANSCEIVE, already rejected handles not opened by the requesting session.