Linux Kernel KSMBD SMB Direct Integer Underflow Remote Code Execution Vulnerability
An integer underflow in the KSMBD SMB Direct transmit function lets a remote attacker send malformed data that is not properly validated before a memory write. This could allow arbitrary code execution in the kernel context on systems with SMB Direct enabled.
Originally disclosed on Zero Day Initiative
This vulnerability allows remote attackers to execute arbitrary code on affected installations of Linux Kernel KSMBD. Authentication may or may not be required to exploit this vulnerability, depending upon configuration.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a missing size or length check on user-supplied data in the RDMA transmit path, causing an integer underflow that leads to an out-of-bounds memory write.
Impact
A remote attacker could execute arbitrary code in the kernel context; authentication may or may not be needed depending on configuration, and only systems with SMB Direct enabled are vulnerable.
What the attacker needed
SMB Direct enabled; Network access to the KSMBD service; Authentication depends on configuration
The fix
Linux issued an update to correct the vulnerability.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
KSMBD is a file-sharing server built into the Linux kernel. A maths error when handling incoming network data can make the server write to the wrong place in memory, and an attacker could use that to run their own code with the highest privileges. Only machines that have turned on a specific fast-networking feature called SMB Direct are affected.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.