Commit 620d133
ksmbd: add permission checks for FSCTL_DUPLICATE_EXTENTS_TO_FILE
commit 388e413 upstream.
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.
Cc: stable@vger.kernel.org
Signed-off-by: Gil Portnoy <dddhkts1@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent aa37f5f commit 620d133
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8482 | 8482 | | |
8483 | 8483 | | |
8484 | 8484 | | |
| 8485 | + | |
| 8486 | + | |
| 8487 | + | |
| 8488 | + | |
| 8489 | + | |
| 8490 | + | |
| 8491 | + | |
| 8492 | + | |
| 8493 | + | |
| 8494 | + | |
| 8495 | + | |
8485 | 8496 | | |
8486 | 8497 | | |
8487 | 8498 | | |
| |||
0 commit comments