{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139231","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-11-30T13:22:15.921Z","datePublished":"2026-11-30T13:32:50.129Z","dateUpdated":"2026-12-01T05:41:56.580Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-12-01T05:41:56.580Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: smbdirect: don't WARN on an unexpected receive opcode\n\nThe receive completion handlers smbdirect_connection_recv_io_done(),\nsmbdirect_accept_negotiate_recv_done() and\nsmbdirect_connect_negotiate_recv_done() verify that the completion is a\nregular receive with WARN_ON_ONCE(wc->opcode != IB_WC_RECV).\n\nBut wc->opcode is controlled by the remote peer: a posted receive work\nrequest is consumed not only by an incoming SEND, but also by an RDMA\nWrite with Immediate, which completes as IB_WC_RECV_RDMA_WITH_IMM. An\nunauthenticated peer can transmit such a message, even before the\nnegotiate completes, so it reaches the accept/connect negotiate\nhandlers as well. With panic_on_warn set this is a remote denial of\nservice, and otherwise it still taints the kernel and spams the log for\nsomething a peer can trigger at will.\n\nThe opcode check itself was inherited from the original client and\nserver recv_done() handlers (fs/smb/client/smbdirect.c and\nfs/smb/server/transport_rdma.c), where an unexpected opcode was simply\nlogged and the connection was torn down. Only the WARN_ON_ONCE() was\nadded on top during the socketization rework. Drop the WARN_ON_ONCE()\nand keep the existing graceful error path, which logs the unexpected\nopcode (unless the status is IB_WC_WR_FLUSH_ERR) and tears the\nconnection down."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","baseScore":7.5,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:N - The opcode check sits in smbdirect_accept_negotiate_recv_done(). A remote peer reaches it by sending an RDMA Write with Immediate over RoCEv2 or iWARP to ksmbd's SMB Direct listener, which binds INADDR_ANY on port 445 or 5445. That write uses up the posted receive and completes with wc->opcode = IB_WC_RECV_RDMA_WITH_IMM, a value the peer chooses. RoCEv2 and iWARP are routable.\nAC:L - The peer decides which opcode to send. A zero-length Write-with-Immediate needs no valid rkey, and the QP is set up with IB_ACCESS_REMOTE_WRITE by cm/iwcm, so the WARN_ON_ONCE fires on the first such message without any race or timing condition.\nPR:N - smbdirect_accept_connect_request() posts the negotiate recv_io before rdma_accept(). The malicious completion therefore arrives before the SMB Direct negotiate and well before any SMB session setup or authentication.\nUI:N - Once ksmbd is serving SMB Direct, it accepts the attacker's RDMA CM connection and processes the completion without any victim action.\nS:U - The impact stays in the host kernel that runs the ksmbd SMB Direct transport. No guest/host, IOMMU or sandbox boundary is crossed.\nC:N - After the WARN_ON_ONCE, the handler takes its normal error path: it logs the opcode and jumps to error/schedule_cleanup. No memory is read out of bounds and nothing is disclosed.\nI:N - The fix removes only the WARN_ON_ONCE wrapper. The existing teardown already handled an unexpected opcode correctly, so no memory is corrupted and no state is modified.\nA:H - A peer can trigger the WARN_ON_ONCE in smbdirect_accept_negotiate_recv_done() at will, before authentication. On hosts with panic_on_warn set it panics the kernel, a remote denial of service; on other hosts it taints the kernel and the peer's connection is torn down."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/smbdirect/accept.c","fs/smb/smbdirect/connect.c","fs/smb/smbdirect/connection.c"],"versions":[{"version":"ea4151222a93d3bfd5d5c438d1c286a5dcff846c","lessThan":"1f53d5fc06bd34f1debc5bc31337a267e76c8a5e","status":"affected","versionType":"git"},{"version":"ea4151222a93d3bfd5d5c438d1c286a5dcff846c","lessThan":"e8592dec2e935befe842f90f4044d210f59c4d30","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/smbdirect/accept.c","fs/smb/smbdirect/connect.c","fs/smb/smbdirect/connection.c"],"versions":[{"version":"7.1","status":"affected"},{"version":"0","lessThan":"7.1","status":"unaffected","versionType":"semver"},{"version":"7.3.6","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.1","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.1","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/1f53d5fc06bd34f1debc5bc31337a267e76c8a5e"},{"url":"https://git.kernel.org/stable/c/e8592dec2e935befe842f90f4044d210f59c4d30"}],"title":"smb: smbdirect: don't WARN on an unexpected receive opcode","x_generator":{"engine":"bippy-1.2.0"}}}}