]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cifs: open_cached_dir(): add FILE_READ_EA to desired access
authorEugene Korenevsky <ekorenevsky@astralinux.ru>
Fri, 1 Mar 2024 14:53:44 +0000 (17:53 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:11:28 +0000 (15:11 +0200)
[ Upstream commit f1b8224b4e6ed59e7e6f5c548673c67410098d8d ]

Since smb2_query_eas() reads EA and uses cached directory,
open_cached_dir() should request FILE_READ_EA access.

Otherwise listxattr() and getxattr() will fail with EACCES
(0xc0000022 STATUS_ACCESS_DENIED SMB status).

Link: https://bugzilla.kernel.org/show_bug.cgi?id=218543
Cc: stable@vger.kernel.org
Signed-off-by: Eugene Korenevsky <ekorenevsky@astralinux.ru>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/cached_dir.c

index 5730c65ffb40d278f4952896527ad4d556a8350c..15e1215bc4e5ae6ee5b75f224c9f356b3c6652bd 100644 (file)
@@ -233,7 +233,8 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
                .tcon = tcon,
                .path = path,
                .create_options = cifs_create_options(cifs_sb, CREATE_NOT_FILE),
-               .desired_access =  FILE_READ_DATA | FILE_READ_ATTRIBUTES,
+               .desired_access =  FILE_READ_DATA | FILE_READ_ATTRIBUTES |
+                                  FILE_READ_EA,
                .disposition = FILE_OPEN,
                .fid = pfid,
        };