From: Marios Makassikis mmakassikis@freebox.fr
mainline inclusion from mainline-5.15-rc1 commit a299669b2c3d26cdb787ba4a87603f6de4fd7714 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA
Reference: https://git.kernel.org/torvalds/linux/c/a299669b2c3d
-------------------------------
[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: Marios Makassikis mmakassikis@freebox.fr Signed-off-by: Namjae Jeon namjae.jeon@samsung.com Signed-off-by: Steve French stfrench@microsoft.com Signed-off-by: Jason Yan yanaijie@huawei.com Signed-off-by: Zhong Jinghua zhongjinghua@huawei.com --- fs/cifsd/smb2pdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/cifsd/smb2pdu.c b/fs/cifsd/smb2pdu.c index 343e96ccdd4c..73c6154170cf 100644 --- a/fs/cifsd/smb2pdu.c +++ b/fs/cifsd/smb2pdu.c @@ -5352,7 +5352,7 @@ static int set_file_allocation_info(struct ksmbd_work *work, struct inode *inode; int rc;
- if (!is_attributes_write_allowed(fp)) + if (!(fp->daccess & FILE_WRITE_DATA_LE)) return -EACCES;
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, struct inode *inode; int rc;
- if (!is_attributes_write_allowed(fp)) + if (!(fp->daccess & FILE_WRITE_DATA_LE)) return -EACCES;
file_eof_info = (struct smb2_file_eof_info *)buf;