[PATCH 09/15] ksmbd: support security.xfstests on POSIX EA handles

Ze Tan <[email protected]> Fri, 24 Jul 2026 18:40:03 +0800
Newsgroups org.kernel.vger.linux-cifs
Message-ID <6b25ed84002643c3e324f76da8da018f7ad20144.1784888897.git.tanze@kylinos.cn>
Add security.xfstests to the exact native xattr allowlist. It uses the
same per-open POSIX activation, root or admin authorization, collision
handling, and list filtering as security.capability.

With the matching POSIX client support applied, the mapping can be
checked with CIFS_MNT set on the client and SHARE_ROOT set on the
server:

  $ file="$CIFS_MNT/security-xfstests"
  $ touch "$file"
  $ setfattr -n security.xfstests -v attr "$file"
  $ test "$(getfattr --only-values -n security.xfstests "$file")" = attr

On the server:

  $ file="$SHARE_ROOT/security-xfstests"
  $ test "$(getfattr --only-values -n security.xfstests "$file")" = attr

Signed-off-by: Ze Tan <[email protected]>
---
 fs/smb/server/smb2pdu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 6baeac99b12f..dba97df7b29f 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -2645,6 +2645,7 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
 
 static const char * const ksmbd_native_xattr_names[] = {
 	XATTR_NAME_CAPS,
+	XATTR_SECURITY_PREFIX "xfstests",
 };
 
 static bool ksmbd_native_xattrs_allowed(struct ksmbd_work *work)
-- 
2.43.0