HIGH Introduced in 6.16
smb NativeSymlink Overflow
CVE-2026-98318
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: smb: client: validate absolute native symlink targets before NT fixups With symlinkroot unset, an absolute target is copied without conversion to an NT drive path. Later code still assumes an NT prefix is present when modifying the target and calculating the print name length. For "/ab", this causes two failures: sym[5] and path[5] are written past their allocations, and plen -= 2 * poff subtracts an assumed 8-byte prefix from a 6-byte UTF-16 target, wrapping u16 plen to 65534. That underflow causes another overflow: memcpy() copies 65534 bytes into a 24-byte buffer. A user with write access to a mounted share can trigger these bugs with default settings. Validate the NT drive prefix, including an ASCII drive letter, before accessing fixed offsets or subtracting the prefix length.
02KernelScan AI Analysis
Risk summary
A local user with write access to a mounted SMB share can create a native symlink with a short absolute target (e.g. "/ab") that triggers an out-of-bounds write and a u16 length underflow, causing a massive heap buffer overflow when the kernel processes the symlink. This can lead to kernel memory corruption, privilege escalation, or a system crash. The bug is reachable with default mount settings when the symlinkroot option is not set.
Vulnerability analysis
When creating a native SMB symlink with an absolute path target and no symlinkroot configured, the client code assumes the target contains a full NT drive prefix and blindly writes to fixed offsets within the target buffer while subtracting the assumed prefix length from the target length. A short target like "/ab" lacks that prefix, so the fixed-offset writes overflow the allocated buffer and the length subtraction underflows a 16-bit value to roughly 65534, which then drives a memcpy that copies tens of thousands of bytes into a small heap buffer. The fix validates that the target actually begins with a well-formed NT drive prefix—including an ASCII drive letter—before touching any fixed offsets or subtracting the prefix length, returning an error otherwise. Any user with write permission to a mounted SMB share can trigger this with default mount settings; no root or special capabilities are required beyond having the share already mounted.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.15 | 6.15.6 | 6.16 | 6913ff607c2b |
| 7.2 | 6.16 | 7.2.8 | 23c240d9509e |
| mainline | 6.16 | 7.3 | — |