[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHC9VhT0=Useuop92s4J9CGNpXa54r4NYnY9DOTnGmoo0hNv5w@mail.gmail.com>
Date: Wed, 1 May 2024 16:47:37 -0400
From: Paul Moore <paul@...l-moore.com>
To: felix <fuzhen5@...wei.com>, linux-security-module@...r.kernel.org
Cc: casey@...aufler-ca.com, roberto.sassu@...wei.com, stefanb@...ux.ibm.com,
zohar@...ux.ibm.com, kamrankhadijadj@...il.com, andrii@...nel.org,
omosnace@...hat.com, linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
xiujianfeng@...wei.com, wangweiyang2@...wei.com
Subject: Re: [PATCH -next] lsm: fix default return value for inode_set(remove)xattr
On Wed, May 1, 2024 at 12:02 PM Paul Moore <paul@...l-moore.com> wrote:
> On Mon, Apr 29, 2024 at 7:47 AM felix <fuzhen5@...wei.com> wrote:
> >
> > From: Felix Fu <fuzhen5@...wei.com>
> >
> > The return value of security_inode_set(remove)xattr should
> > be 1. If it return 0, cap_inode_setxattr would not be
> > executed when no lsm exist, which is not what we expected,
> > any user could set some security.* xattr for a file.
> >
> > Before commit 260017f31a8c ("lsm: use default hook return
> > value in call_int_hook()") was approved, this issue would
> > still happened when lsm only include bpf, because bpf_lsm_
> > inode_setxattr return 0 by default which cause cap_inode_set
> > xattr to be not executed.
> >
> > Fixes: 260017f31a8c ("lsm: use default hook return value in call_int_hook()")
> > Signed-off-by: Felix Fu <fuzhen5@...wei.com>
> > ---
> > include/linux/lsm_hook_defs.h | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Adding the LSM list as that is the important list for this patch.
It's also worth noting the discussion below from earlier this year. I
just spent a little bit of time working on a different solution which
I personally find more acceptable; I'm building a test kernel now,
assuming it works I'll post it as a RFC.
https://lore.kernel.org/linux-security-module/20240129133058.1627971-1-omosnace@redhat.com/
--
paul-moore.com
Powered by blists - more mailing lists