CRITICAL Introduced in 2.6.30
smb TreeConnect OOB
CVE-2026-89631
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
KernelScan AI9.1CRITICAL
01Description
In the Linux kernel, the following vulnerability has been resolved: smb: client: reject a tree connect response whose byte count is too small CIFSTCon() bounds its strnlen() over the byte area with the server's ByteCount minus two, which for ByteCount 0 or 1 goes negative as an int and converts to a huge size_t. The later subtraction wraps the __u16 bytes_left, and that is what bounds cifs_strndup_from_utf16(): a bound of up to 65535 against a ~16 KB cifs_req_poolp object runs off the end of the slab object, and the bytes reach userspace through tcon->nativeFileSystem in /proc/fs/cifs/DebugData. Reject a byte area too small for what the parser consumes. Two bytes is the least it can consume, and no conformant response carries fewer. The new trace point is the 129th smb_eio_trace entry, which __mode(byte) cannot represent, so the attribute goes with it.
02KernelScan AI Analysis
Risk summary
A malicious or compromised SMB server can send a crafted tree-connect response that causes the Linux CIFS client to read far beyond its allocated buffer, leaking kernel heap memory to userspace and potentially crashing the kernel. Any system that mounts CIFS/SMB shares from an untrusted or potentially compromised server is at risk. The attacker needs no privileges on the victim — only control of the server endpoint.
Vulnerability analysis
The SMB client's tree-connect response parser uses the server-supplied ByteCount field in arithmetic without first checking that it is large enough. When a malicious server sends a response with a ByteCount of 0 or 1, the subtraction wraps to a huge value, causing the parser to read thousands of bytes past the end of the allocated response buffer. The excess data is copied into a filesystem-name string that is later exposed through debug data, leaking kernel heap memory to userspace; the read can also panic the kernel if it crosses into unmapped memory. The fix rejects any tree-connect response whose byte area is smaller than the two bytes the parser minimally consumes. Any system that mounts CIFS/SMB shares from a server controlled by or compromised by an attacker can be affected — the attacker needs no privileges on the client, only control of the server endpoint or a position to intercept the connection.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.18 | 2.6.30 | 6.18.51 | 3be89e8039a8 |
| 7.2 | 2.6.30 | 7.2.4 | 411e484fe71a |
| mainline | 2.6.30 | 7.3-rc1 | 65deb1835934 |