[RFC PATCH 7/9] ksmbd: support security.xfstests EAs
From: Ze Tan
Date: Wed Jul 15 2026 - 03:50:19 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 255300501af3..ea622798f34e 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -2741,11 +2741,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