[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d955d8b5-ca2e-c040-9415-772fa5a71bc7@schaufler-ca.com>
Date: Thu, 1 Sep 2022 09:45:51 -0700
From: Casey Schaufler <casey@...aufler-ca.com>
To: Al Viro <viro@...iv.linux.org.uk>,
Christian Göttsche <cgzones@...glemail.com>
Cc: selinux@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
Luis Chamberlain <mcgrof@...nel.org>,
LSM List <linux-security-module@...r.kernel.org>
Subject: Re: [RFC PATCH 1/2] fs/xattr: add *at family syscalls
On 8/31/2022 3:17 PM, Al Viro wrote:
> [linux-arch Cc'd for ABI-related stuff]
The LSM list <linux-security-module@...r.kernel.org> should be on
this thread as SELinux isn't the only security module that uses xattrs
extensively.
>
> On Tue, Aug 30, 2022 at 05:28:39PM +0200, Christian Göttsche wrote:
>> Add the four syscalls setxattrat(), getxattrat(), listxattrat() and
>> removexattrat() to enable extended attribute operations via file
>> descriptors. This can be used from userspace to avoid race conditions,
>> especially on security related extended attributes, like SELinux labels
>> ("security.selinux") via setfiles(8).
>>
>> Use the do_{name}at() pattern from fs/open.c.
>> Use a single flag parameter for extended attribute flags (currently
>> XATTR_CREATE and XATTR_REPLACE) and *at() flags to not exceed six
>> syscall arguments in setxattrat().
> I've no problems with the patchset aside of the flags part;
> however, note that XATTR_CREATE and XATTR_REPLACE are actually exposed
> to the network - the values are passed to nfsd by clients.
> See nfsd4_decode_setxattr() and
> BUILD_BUG_ON(XATTR_CREATE != SETXATTR4_CREATE);
> BUILD_BUG_ON(XATTR_REPLACE != SETXATTR4_REPLACE);
> in encode_setxattr() on the client side.
>
> Makes me really nervous about constraints like that. Sure,
> AT_... flags you are using are in the second octet and these are in
> the lowest one, but...
Powered by blists - more mailing lists