[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHC9VhSOqvKm5wNPp_7O+cayMf3gopeLu=uDoP5kmfvqtp40WQ@mail.gmail.com>
Date: Sat, 26 Apr 2025 12:56:41 -0400
From: Paul Moore <paul@...l-moore.com>
To: Stephen Smalley <stephen.smalley.work@...il.com>
Cc: Christian Brauner <brauner@...nel.org>, omosnace@...hat.com, selinux@...r.kernel.org,
linux-security-module@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs/xattr.c: fix simple_xattr_list to always include
security.* xattrs
On Fri, Apr 25, 2025 at 11:14 AM Stephen Smalley
<stephen.smalley.work@...il.com> wrote:
> On Fri, Apr 25, 2025 at 5:20 AM Christian Brauner <brauner@...nel.org> wrote:
> > On Thu, Apr 24, 2025 at 11:28:20AM -0400, Stephen Smalley wrote:
...
> > > + if (err < 0)
> > > + return err;
> > > +
> > > + if (buffer) {
> > > + if (remaining_size < err)
> > > + return -ERANGE;
> > > + buffer += err;
> > > + }
> > > + remaining_size -= err;
> >
> > Really unpleasant code duplication in here. We have xattr_list_one() for
> > that. security_inode_listxattr() should probably receive a pointer to
> > &remaining_size?
>
> Not sure how to avoid the duplication, but willing to take it inside
> of security_inode_listsecurity() and change its hook interface if
> desired.
We talked about moving to xattr_list_one() in the other RFC thread
earlier this week and as previously mentioned I think it's the right
thing to do. However, considering the issue with the new coreutils
release, I think it's best to keep this patch limited to the fixes
necessary to restore the desired behavior with the recent coreutils;
this should make life easier for distro and stable backports. We can
address the LSM hook cleanup/rework in a second patch{set} afterwards.
--
paul-moore.com
Powered by blists - more mailing lists