Bug 218543

Summary: CIFS: listxattr() fails with EACCES
Product: File System Reporter: Eugene Korenevsky (eugene)
Component: CIFSAssignee: fs_cifs (fs_cifs)
Status: NEW ---    
Severity: normal    
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:
Attachments: proposed patch

Description Eugene Korenevsky 2024-03-01 14:21:46 UTC
Windows version of SMB host: Windows Server 2012 R2 x64
Kernel: 6.8.0-rc6 (git://git.samba.org/sfrench/cifs-2.6, d206a76d)
CONFIG_CIFS_XATTR=y in kernel config

Steps to reproduce:

mkdir temp
sudo mount.cifs //192.168.56.130/temp ~/temp/ -o user,username=...,password=...
$ sudo getfattr -d temp

getfattr prints:
getfattr: temp: Permission denied

CIFS debug log:

[  169.784045] CIFS: Status code returned 0xc0000022 STATUS_ACCESS_DENIED
[  169.784649] CIFS: fs/smb/client/smb2maperror.c: Mapping SMB2 status code 0xc0000022 to POSIX err -13
[  169.785428] CIFS: fs/smb/client/xattr.c: VFS: leaving cifs_listxattr (xid = 5) rc = -13

strace output:
listxattr("temp", NULL, 0)              = -1 EACCES (Permission denied)

Required behavior: getfattr executed successfully.

This is a regression. The bug is not reproduced at kernel 5.15.148.
Comment 1 Eugene Korenevsky 2024-03-13 12:41:06 UTC
Created attachment 305986 [details]
proposed patch