HIGH
smb RecvCredit Race
CVE-2026-31538
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
KernelScan AI5.9MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: smb: server: make use of smbdirect_socket.recv_io.credits.available The logic off managing recv credits by counting posted recv_io and granted credits is racy. That's because the peer might already consumed a credit, but between receiving the incoming recv at the hardware and processing the completion in the 'recv_done' functions we likely have a window where we grant credits, which don't really exist. So we better have a decicated counter for the available credits, which will be incremented when we posted new recv buffers and drained when we grant the credits to the peer. This fixes regression Namjae reported with the 6.18 release.
02KernelScan AI Analysis
Risk summary
A race condition in SMB Direct credit management could cause connection failures and server instability. The vulnerability affects systems running SMB servers with RDMA support enabled, potentially causing denial of service when authenticated clients connect over SMB Direct.
Vulnerability analysis
The vulnerability stems from a race condition in the SMB Direct (RDMA) credit management system. The original code calculated available credits by subtracting granted credits from posted receive buffers, but there's a timing window between hardware packet reception and software completion processing where peers may consume credits that the server hasn't accounted for yet. This could lead to granting non-existent credits, corrupting the credit accounting protocol. The fix introduces a dedicated atomic counter for available credits that is incremented when buffers are posted and atomically drained when credits are granted, eliminating the race condition. The attack surface is network-facing SMB servers with RDMA support enabled.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.18 | 6.18.11 | 66c082e3d465 |
| 6.19 | 6.19.1 | 809cbd31aa4f |
| mainline | 7.0 | 26ad87a2cfb8 |