CVE-2026-99750: ksmbd: require DELETE access for delete-on-close opens
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: require DELETE access for delete-on-close opens
smb2open() accepts FILEDELETEONCLOSE on an existing file without DELETE in DesiredAccess. When the request asks only for FILEREADATTRIBUTES or READCONTROL, it also skips inodepermission() and the parent directory MAYWRITE | MAYEXEC check that delete-on-close is meant to get. The file is then marked for deletion by a caller who could not delete it.
The unlink happens later, in ksmbdinodeclose(), when the last handle on the inode is closed, and it runs with the credentials of that handle. If the caller closes last, the unlink fails. If another user who can write the parent directory, such as the file's owner, still has the file open, the file is deleted when that user closes it. Until then new opens of the file fail with STATUSDELETEPENDING. So a user with only search permission on a directory can delete a file in it, or block opens of it, while the owner has it open.
A MAXIMUMALLOWED open that also requests DELETE has the same problem. The requested access is replaced with the maximal access, which does not include DELETE when the caller cannot write the parent directory, and the later permission checks are skipped as already done.
MS-FSA 2.1.5.1 requires an open with FILEDELETEONCLOSE and without DELETE in DesiredAccess to fail with STATUSINVALIDPARAMETER, and Samba does the same. Add that check to the CreateOptions validation, using the generic-mapped DesiredAccess so that GENERICALL still qualifies. This also refuses MAXIMUMALLOWED with FILEDELETEONCLOSE but no explicit DELETE, as MS-FSA and Samba do. When MAXIMUMALLOWED is requested with DELETE but the maximal access does not include DELETE, fail with STATUSACCESSDENIED. With DELETE requested, delete-on-close opens go through the existing parent directory check.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.5-1 - Compensating control
In ksmbd CreateOptions validation, require DELETE in the generic-mapped DesiredAccess for FILE_DELETE_ON_CLOSE opens; reject requests without DELETE with STATUS_INVALID_PARAMETER, and reject MAXIMUM_ALLOWED requests with DELETE when the maximal access does not include DELETE with STATUS_ACCESS_DENIED.
Event History
Frequently Asked Questions
Who can exploit this issue?
An SMB client user who has only search permission on a directory can trigger the condition against a file in that directory. The user does not need DELETE access to the file if they can open it with FILE_DELETE_ON_CLOSE while requesting only FILE_READ_ATTRIBUTES or READ_CONTROL.
What is required for the file to actually be deleted?
The vulnerable caller can mark the file for deletion, but deletion occurs only when the last handle is closed. If the caller closes last, the unlink fails; if another user with permission to write the parent directory still has the file open and closes it last, the file is deleted.
What impact can occur before the file is removed?
After the file is marked for deletion, new opens fail with STATUS_DELETE_PENDING until the final handle closes. This allows a user without delete permission to deny access to the file even if deletion does not ultimately succeed.