lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0682348d9601ca3847ce9ba035e4ab1b586cf712.camel@huaweicloud.com>
Date:   Wed, 07 Dec 2022 10:17:49 +0100
From:   Roberto Sassu <roberto.sassu@...weicloud.com>
To:     Paul Moore <paul@...l-moore.com>,
        David Howells <dhowells@...hat.com>
Cc:     casey@...aufler-ca.com, omosnace@...hat.com,
        john.johansen@...onical.com, kpsingh@...nel.org,
        bpf@...r.kernel.org, linux-security-module@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Roberto Sassu <roberto.sassu@...wei.com>
Subject: Re: [PATCH v2 2/2] lsm: Add/fix return values in lsm_hooks.h and
 fix formatting

On Wed, 2022-12-07 at 08:58 +0100, Roberto Sassu wrote:
> On Tue, 2022-12-06 at 19:21 -0500, Paul Moore wrote:
> > On Mon, Nov 28, 2022 at 9:43 AM Roberto Sassu
> > <roberto.sassu@...weicloud.com> wrote:
> > > From: Roberto Sassu <roberto.sassu@...wei.com>
> > > 
> > > Ensure that for non-void LSM hooks there is a description of the return
> > > values.
> > > 
> > > Also, replace spaces with tab for indentation, remove empty lines between
> > > the hook description and the list of parameters, adjust semicolons and add
> > > the period at the end of the parameter description.
> > > 
> > > Finally, move the description of gfp parameter of the
> > > xfrm_policy_alloc_security hook together with the others.
> > > 
> > > Signed-off-by: Roberto Sassu <roberto.sassu@...wei.com>
> > > ---
> > >  include/linux/lsm_hooks.h | 221 ++++++++++++++++++++++++--------------
> > >  1 file changed, 138 insertions(+), 83 deletions(-)
> > 
> > Thanks Roberto, I've merged this into lsm/next with one small tweak (below).
> > 
> > > diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
> > > index c35e260efd8c..6502a1bea93a 100644
> > > --- a/include/linux/lsm_hooks.h
> > > +++ b/include/linux/lsm_hooks.h
> > > @@ -677,7 +695,7 @@
> > >   *     indicates which of the set*uid system calls invoked this hook.  If
> > >   *     @new is the set of credentials that will be installed.  Modifications
> > >   *     should be made to this rather than to @current->cred.
> > > - *     @old is the set of credentials that are being replaces
> > > + *     @old is the set of credentials that are being replaces.
> > 
> > Might as well change "replaces" to "replaced".  I'll go ahead and fix
> > that up during the merge.
> 
> Thanks a lot!

Ops, I found an issue for fs_context_parse_param. It seems that the
kernel doc and lsm_hooks.h provide different conventions for it.

+ David

Kernel doc:

It should return 0 to indicate that the parameter should be passed on
to the filesystem, 1 to indicate that the parameter should be discarded
or an error to indicate that the parameter should be rejected.

lsm_hooks.h:

The LSM may reject it with an error and may use it for itself, in which
case it should return 0; otherwise it should return -ENOPARAM to pass
it on to the filesystem.

Looking at the code, the latter seems the right one. I would send
another patch to fix the kernel doc.

For this patch, I saw it is already in lsm/next. Paul, should I do an
incremental patch or change the one in the repo and you force push it?
I would just remove the three lines after the parameters description.

Thanks

Roberto

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ