CVE-2026-99562: ksmbd: reject FSCTL_SET_ZERO_DATA on a directory handle
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: reject FSCTLSETZERODATA on a directory handle
An authenticated client with a writable tree connection can open a directory with FILEWRITEDATA and send FSCTLSETZERODATA on that handle. The handler only checks fp->daccess & FILEWRITEDATALE, but on a directory FILEWRITEDATA is the legitimate add-file right, so the check passes. ksmbdvfszerodata() then calls kernelwrite() on the directory file, which has no FMODEWRITE, and kernelwriteiter() hits WARNONONCE(!(file->fmode & FMODEWRITE)), panicking a paniconwarn kernel.
Before commit 25e414db7033 ("ksmbd: report holes in allocated range queries") the dense-file path used vfsfallocate(), which rejects directories with -EISDIR. The kernelwrite() loop that replaced it has no such check. Reject a directory handle in ksmbdvfszerodata() before writing, as ksmbdvfswrite() already does for SMB2WRITE.
WARNING: fs/readwrite.c:608 at kernelwriteiter+0x74b/0x8c0 Workqueue: ksmbd-io handleksmbdwork Call Trace: kernelwrite+0x1ef/0x4d0 ksmbdvfszerodata+0x413/0x590 smb2ioctl+0x21fa/0x66a0 handleksmbdwork+0x61b/0x1ff0
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2