提交 a299669b 编写于 作者: M Marios Makassikis 提交者: Steve French

cifsd: Update access check in set_file_allocation_info/set_end_of_file_info

[MS-SMB2] 3.3.5.21.1
  If the object store supports security and FileInfoClass is
  FileAllocationInformation, FileEndOfFileInformation, or
  FileValidDataLengthInformation, and Open.GrantedAccess does not
  include FILE_WRITE_DATA, the server MUST fail the request with
  STATUS_ACCESS_DENIED.
Signed-off-by: NMarios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 73f9dad5
...@@ -5352,7 +5352,7 @@ static int set_file_allocation_info(struct ksmbd_work *work, ...@@ -5352,7 +5352,7 @@ static int set_file_allocation_info(struct ksmbd_work *work,
struct inode *inode; struct inode *inode;
int rc; int rc;
if (!is_attributes_write_allowed(fp)) if (!(fp->daccess & FILE_WRITE_DATA_LE))
return -EACCES; return -EACCES;
file_alloc_info = (struct smb2_file_alloc_info *)buf; file_alloc_info = (struct smb2_file_alloc_info *)buf;
...@@ -5396,7 +5396,7 @@ static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp, ...@@ -5396,7 +5396,7 @@ static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp,
struct inode *inode; struct inode *inode;
int rc; int rc;
if (!is_attributes_write_allowed(fp)) if (!(fp->daccess & FILE_WRITE_DATA_LE))
return -EACCES; return -EACCES;
file_eof_info = (struct smb2_file_eof_info *)buf; file_eof_info = (struct smb2_file_eof_info *)buf;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册