From: Ralph Boehme <slow@samba.org>
To: tanze <tanze@kylinos.cn>,
sfrench@samba.org, linkinjeon@kernel.org, pc@manguebit.org,
sprasad@microsoft.com, tom@talpey.com, senozhatsky@chromium.org,
chenxiaosong@chenxiaosong.com, linux-cifs@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Jeremy Allison <jra@samba.org>,
Stefan Metzmacher <metze@samba.org>
Subject: Re: [RFC PATCH v2 6/9] ksmbd: support security.capability EAs
Date: Tue, 21 Jul 2026 15:38:41 +0200 [thread overview]
Message-ID: <3cef100e-48e6-4fdd-b7e3-a7f2ac2c02ce@samba.org> (raw)
In-Reply-To: <5fa257a4-456e-4917-9249-bb3457952335@kylinos.cn>
[-- Attachment #1.1: Type: text/plain, Size: 3537 bytes --]
On 7/20/26 3:06 PM, tanze wrote:
> Thanks for your question. When the CIFS client accesses user.EA, the
> name transmitted over the SMB protocol is simply EA instead of user.EA.
> ksmbd then prepends user. to convert it back to user.EA. If we pass
> every attribute name directly to the VFS unmodified, other types of
> extended attributes will return -EOPNOTSUPP due to missing handlers.
yup, but I guess that's exactly what we want.
If I get that right your proposal is
Client Network Server
-------------------------------------------------
user.foo foo user.foo
system.bar system.bar system.bar
This seems wrong (user namespace not prefixed, others prefixed).
What we might want to do instead is send the namespace over the wire in
all cases, but in a separate protocol field (expressed by splitting the
dotted string into two words seperated by a comma):
Client Network Server
=============================================================
Linux: Linux:
user.foo user, foo user.foo
system.bar system, bar system.bar
FreeBSD: Linux:
*1, foo user, foo user.foo
*2, bar system, bar system.bar
*1: EXTATTR_NAMESPACE_USER
*2: EXTATTR_NAMESPACE_SYSTEM
This way we have a clear way how implementations can map their namespace
to the protocol, and server and client know exactly what to do.
Thoughts?
-slow
>
> The current workflow works as follows:
>
> Client request --user.EA
> ↓ CIFS client strips off the "user."
> prefix SMB EA layer receives: --EA
> ↓ ksmbd adds back the "user."
> prefix Server filesystem layer: --user.EA
>
> After ksmbd finishes mapping to the underlying extended attribute name,
> filesystem compatibility checks, value validation and all related
> operations should be delegated uniformly to |vfs_setxattr()|. This
> mapping logic is not meant to duplicate the full set of xattr namespaces
> supported by the VFS. Instead, it filters which SMB extended attribute
> names get parsed as native Linux xattr names.
>
> I will revise the patch to enable native namespace mapping only when
> both of the following two conditions are satisfied:
>
> 1.The request is sent with POSIX extended attribute parameters;
> 2. The mapped server-side user account is root or an account with
> administrative privileges.
>
> Thanks!
>
>
> 在 2026/7/20 14:57, Ralph Boehme 写道:
>> On 7/17/26 5:39 AM, Ze Tan wrote:
>>> +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;
>>> +
>>> + return false;
>>> +}
>>> +
>>> +static int ksmbd_map_ea_name_to_xattr(bool posix_extensions,
>>> + const char *ea_name, size_t ea_name_len,
>>> + char *attr_name)
>>> +{
>>> + if (posix_extensions &&
>>> + ksmbd_is_posix_ea_name(ea_name, ea_name_len)) {
>>
>> why the check for allowed namespaces via ksmbd_is_posix_ea_name() at
>> all and not just pass through whatever the client sends us, pass it
>> down and let the xattr subsystem deal with it?
>>
>> Still wrapping my head around this so I might be missing something
>> obvious. :)
>>
>> Thanks!
>> -slow
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2026-07-21 13:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 3:39 [RFC PATCH v2 0/9] smb: support security and trusted xattrs over EAs Ze Tan
2026-07-17 3:39 ` [RFC PATCH v2 1/9] smb: client: support security.capability " Ze Tan
2026-07-20 5:21 ` Namjae Jeon
2026-07-17 3:39 ` [RFC PATCH v2 2/9] smb: client: support security.xfstests " Ze Tan
2026-07-17 3:39 ` [RFC PATCH v2 3/9] smb: client: support trusted xattrs " Ze Tan
2026-07-17 3:39 ` [RFC PATCH v2 4/9] ksmbd: extract SMB EA backing xattr name mapping Ze Tan
2026-07-17 3:39 ` [RFC PATCH v2 5/9] ksmbd: extract SMB EA response name handling Ze Tan
2026-07-17 3:39 ` [RFC PATCH v2 6/9] ksmbd: support security.capability EAs Ze Tan
2026-07-20 6:57 ` Ralph Boehme
2026-07-20 13:06 ` tanze
2026-07-21 13:38 ` Ralph Boehme [this message]
2026-07-21 16:41 ` Steve French
2026-07-21 17:10 ` Ralph Boehme
2026-07-17 3:39 ` [RFC PATCH v2 7/9] ksmbd: support security.xfstests EAs Ze Tan
2026-07-20 5:03 ` Namjae Jeon
2026-07-20 6:33 ` tanze
2026-07-20 6:36 ` tanze
2026-07-17 3:39 ` [RFC PATCH v2 8/9] ksmbd: support trusted EAs Ze Tan
2026-07-17 3:39 ` [RFC PATCH v2 9/9] ksmbd: avoid self oplock breaks for EA opens Ze Tan
2026-07-20 5:34 ` Namjae Jeon
2026-07-20 8:54 ` tanze
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=3cef100e-48e6-4fdd-b7e3-a7f2ac2c02ce@samba.org \
--to=slow@samba.org \
--cc=chenxiaosong@chenxiaosong.com \
--cc=jra@samba.org \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=metze@samba.org \
--cc=pc@manguebit.org \
--cc=senozhatsky@chromium.org \
--cc=sfrench@samba.org \
--cc=sprasad@microsoft.com \
--cc=tanze@kylinos.cn \
--cc=tom@talpey.com \
/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
all inboxes | Powered by JetHome®