Linux Kernel KSMBD Query Directory Request Race Condition Remote Code Execution Vulnerability
A race condition in the Linux kernel's KSMBD server arises from missing locking when handling directory file objects. An unauthenticated remote attacker could exploit this to execute code in kernel context.
Originally disclosed on Zero Day Initiative
This vulnerability allows remote attackers to execute arbitrary code on affected installations of Linux Kernel KSMBD. Authentication is not required to exploit this vulnerability.
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 lock around operations on dir_fp objects, allowing concurrent access to corrupt shared state.
Impact
An unauthenticated remote attacker could execute arbitrary code in the kernel context, but only on systems with KSMBD enabled.
What the attacker needed
KSMBD enabled on the target; network access to the KSMBD service
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 race condition means two operations happen at the same time in a way the code did not expect, which can corrupt memory. Here that corruption could let someone on the network run their own code with the highest privileges.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.