CVE-2026-139231: smb: smbdirect: don't WARN on an unexpected receive opcode
In the Linux kernel, the following vulnerability has been resolved:
smb: smbdirect: don't WARN on an unexpected receive opcode
The receive completion handlers smbdirectconnectionrecviodone(), smbdirectacceptnegotiaterecvdone() and smbdirectconnectnegotiaterecvdone() verify that the completion is a regular receive with WARNONONCE(wc->opcode != IBWCRECV).
But wc->opcode is controlled by the remote peer: a posted receive work request is consumed not only by an incoming SEND, but also by an RDMA Write with Immediate, which completes as IBWCRECVRDMAWITHIMM. An unauthenticated peer can transmit such a message, even before the negotiate completes, so it reaches the accept/connect negotiate handlers as well. With paniconwarn set this is a remote denial of service, and otherwise it still taints the kernel and spams the log for something a peer can trigger at will.
The opcode check itself was inherited from the original client and server recvdone() handlers (fs/smb/client/smbdirect.c and fs/smb/server/transportrdma.c), where an unexpected opcode was simply logged and the connection was torn down. Only the WARNONONCE() was added on top during the socketization rework. Drop the WARNONONCE() and keep the existing graceful error path, which logs the unexpected opcode (unless the status is IBWCWRFLUSHERR) and tears the connection down.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.6-1 - Compensating control
Remove the WARN_ON_ONCE() check for unexpected receive opcodes in the smbdirect receive completion handlers, and retain the graceful error path that logs the unexpected opcode and tears down the connection.
Event History
Frequently Asked Questions
Who can trigger the issue?
An unauthenticated remote peer can trigger it by sending an RDMA Write with Immediate that is completed as IB_WC_RECV_RDMA_WITH_IMM. This can occur before SMB Direct negotiation has completed.
What is the operational impact if the system does not panic on warnings?
The peer-triggered condition can taint the kernel and repeatedly spam the kernel log. If panic_on_warn is enabled, the same condition can cause a remote denial of service.
What signs indicate that this condition may have been triggered?
Relevant indicators are a kernel warning related to an unexpected receive completion opcode, kernel tainting, and repeated log messages caused by peer-supplied receive completions. The provided information does not identify affected kernel versions.