Skip to content

Commit 3eab0ef

Browse files
committed
ksmbd: test 1
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
1 parent dc11179 commit 3eab0ef

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

smb2pdu.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8765,6 +8765,11 @@ static inline int fsctl_set_sparse(struct ksmbd_work *work, u64 id,
87658765
if (!fp)
87668766
return -ENOENT;
87678767

8768+
if (!(fp->daccess & (FILE_WRITE_DATA_LE | FILE_WRITE_ATTRIBUTES_LE))) {
8769+
ret = -EACCES;
8770+
goto out;
8771+
}
8772+
87688773
old_fattr = fp->f_ci->m_fattr;
87698774
if (sparse->SetSparse)
87708775
fp->f_ci->m_fattr |= ATTR_SPARSE_FILE_LE;

0 commit comments

Comments
 (0)