Linux-CIFS Archive mirror
 help / color / mirror / Atom feed
From: Eugene Korenevsky <ekorenevsky@astralinux.ru>
To: linux-cifs@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] cifs: open_cached_dir(): add FILE_READ_EA to desired access
Date: Fri, 1 Mar 2024 17:53:44 +0300	[thread overview]
Message-ID: <ZeHr+PH8spL5F+iZ@debian-BULLSEYE-live-builder-AMD64> (raw)

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).

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=218543
Signed-off-by: Eugene Korenevsky <ekorenevsky@astralinux.ru>
---
 fs/smb/client/cached_dir.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
index 3de5047a7ff9..a0017724d523 100644
--- a/fs/smb/client/cached_dir.c
+++ b/fs/smb/client/cached_dir.c
@@ -239,7 +239,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,
 		.replay = !!(retries),
-- 
2.30.2


             reply	other threads:[~2024-03-01 14:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 14:53 Eugene Korenevsky [this message]
2024-03-14  4:15 ` [PATCH] cifs: open_cached_dir(): add FILE_READ_EA to desired access Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZeHr+PH8spL5F+iZ@debian-BULLSEYE-live-builder-AMD64 \
    --to=ekorenevsky@astralinux.ru \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).