[RFC PATCH v2 7/9] ksmbd: support security.xfstests EAs

From: Ze Tan

Date: Thu Jul 16 2026 - 23:40:30 EST


Before checking file capabilities, generic/093 calls _require_attrs
security. This helper runs "setfattr -n security.xfstests". ksmbd
recognizes only security.capability as a native security EA, so it stores
the attribute as user.security.xfstests.

Add security.xfstests as another exact security EA name. Use this name
directly for set, get, and list operations. Do not support other security
xattrs.

Signed-off-by: Ze Tan <tanze@xxxxxxxxxx>
---
fs/smb/server/smb2pdu.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 2159b45c80a6..da3d5c217577 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -2650,11 +2650,21 @@ static bool ksmbd_is_security_capability_ea_name(const char *name,
!strncmp(name, XATTR_NAME_CAPS, name_len);
}

+static bool ksmbd_is_security_xfstests_ea_name(const char *name,
+ size_t name_len)
+{
+ return name_len == sizeof(XATTR_SECURITY_PREFIX "xfstests") - 1 &&
+ !strncmp(name, XATTR_SECURITY_PREFIX "xfstests", name_len);
+}
+
static bool ksmbd_is_posix_ea_name(const char *name, size_t name_len)
{
if (ksmbd_is_security_capability_ea_name(name, name_len))
return true;

+ if (ksmbd_is_security_xfstests_ea_name(name, name_len))
+ return true;
+
return false;
}

--
2.43.0