diff mbox series

[1/2] cifs: Do not issue SMB2 CREATE always with FILE_READ_ATTRIBUTES

Message ID 20241005160826.20825-2-pali@kernel.org
State New
Headers show
Series cifs: Improve access without FILE_READ_ATTRIBUTES permission | expand

Commit Message

Pali Rohár Oct. 5, 2024, 4:08 p.m. UTC
Not all SMB2 operations require FILE_READ_ATTRIBUTES access and therefore
do not automatically request for FILE_READ_ATTRIBUTES access in every one
SMB2 CREATE command.

This change allows to complete WRITE operation to a file when it does not
grant FILE_READ_ATTRIBUTES permission and its parent directory does not
grant READ_DATA permission (parent directory READ_DATA is implicit grant of
child FILE_READ_ATTRIBUTES permission).

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 fs/smb/client/smb2file.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/smb/client/smb2file.c b/fs/smb/client/smb2file.c
index 149449d9c1c0..faa634ce4d54 100644
--- a/fs/smb/client/smb2file.c
+++ b/fs/smb/client/smb2file.c
@@ -162,7 +162,6 @@  int smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, __u32
 	if (smb2_path == NULL)
 		return -ENOMEM;
 
-	oparms->desired_access |= FILE_READ_ATTRIBUTES;
 	smb2_oplock = SMB2_OPLOCK_LEVEL_BATCH;
 
 	rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL, &err_iov,