ksmbd: add permission checks for FSCTL_DUPLICATE_EXTENTS_TO_FILE
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ eb817368f50c1cbe1bd07044124aad7db6330e3a · < 388e4139db27a9e3612c9d356b826f5b1ff6a9e3| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: add permission checks for FSCTL_DUPLICATE_EXTENTS_TO_FILE
The FSCTL_DUPLICATE_EXTENTS_TO_FILE arm of smb2_ioctl() overwrites the destination file's data via vfs_clone_file_range() with neither the share-level KSMBD_TREE_CONN_FLAG_WRITABLE check nor a per-handle fp->daccess check that the other write-bearing arms carry. A client can overwrite destination data on a read-only share, or from a handle opened with only FILE_WRITE_ATTRIBUTES (which still yields an FMODE_WRITE filp). FILE_WRITE_ATTRIBUTES-only destination handle overwrote the file's data via the clone. Add both checks, matching the FSCTL_SET_SPARSE permission fix; require FILE_WRITE_DATA since this writes data.
From the CVE record · Linux
The Linux kernel's ksmbd SMB ioctl handler lacks permission checks for FSCTL_DUPLICATE_EXTENTS_TO_FILE. An SMB client can overwrite destination file data on a read-only share or through a destination handle opened with only FILE_WRITE_ATTRIBUTES. The input does not specify authentication requirements or user interaction.
Teams running the Linux kernel with ksmbd should check their installations; affected versions are not specified.