mirror of
https://github.com/torvalds/linux.git
synced 2026-10-08 03:26:02 +02:00
ksmbd: reject FSCTL_SET_SPARSE on directories
FSCTL_SET_SPARSE applies to files. Return STATUS_INVALID_PARAMETER when a client sends it for a directory handle instead of setting the sparse file attribute on the directory. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
parent
159e727f76
commit
31169f4177
|
|
@ -9169,6 +9169,11 @@ static inline int fsctl_set_sparse(struct ksmbd_work *work, u64 id,
|
|||
if (!fp)
|
||||
return -ENOENT;
|
||||
|
||||
if (S_ISDIR(file_inode(fp->filp)->i_mode)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!(fp->daccess & (FILE_WRITE_DATA_LE | FILE_WRITE_ATTRIBUTES_LE))) {
|
||||
ret = -EACCES;
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user