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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHC9VhSdcyOd01VYtqhJGrgKyG3oZmE_1d0RQymxKv1=ErhduQ@mail.gmail.com>
Date:   Thu, 8 Dec 2022 16:59:08 -0500
From:   Paul Moore <paul@...l-moore.com>
To:     Roberto Sassu <roberto.sassu@...weicloud.com>
Cc:     David Howells <dhowells@...hat.com>, 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 Thu, Dec 8, 2022 at 4:29 AM Roberto Sassu
<roberto.sassu@...weicloud.com> wrote:
> On Wed, 2022-12-07 at 14:34 -0500, Paul Moore wrote:
> > On Wed, Dec 7, 2022 at 4:18 AM Roberto Sassu
> > <roberto.sassu@...weicloud.com> wrote:
> > > 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.
> >
> > Just send a patch against the current lsm/next branch to remove those
> > lines, and please do it ASAP as the merge window opens this
> > weekend/Monday.
>
> Ok, was about to send but I would need a clarification first.
>
> In mount_api.rst, there is for security_fs_context_parse_param():
>
>      The value pointed to by param may be modified (if a string) or stolen
>      (provided the value pointer is NULL'd out).  If it is stolen, 0 must be
>      returned to prevent it being passed to the filesystem.
>
> Looking at security.c:
>
>         hlist_for_each_entry(hp, &security_hook_heads.fs_context_parse_param,
>                              list) {
>                 trc = hp->hook.fs_context_parse_param(fc, param);
>                 if (trc == 0)
>                         rc = 0;
>                 else if (trc != -ENOPARAM)
>                         return trc;
>         }
>
> If, as mount_api.rst says, the value is modified by an LSM or stolen,
> should it be passed to other LSMs too?

All of the LSMs should be using fs_parse() in their
fs_context_parse_param() hook to identify the mount options that they
own, skipping those they do not (fs_parse() would return -ENOPARAM in
those cases).  I don't believe we currently have any mount options
that are shared across the different LSMs, so I believe this is a
non-issue.

In the future if we ever find the need to share mount options across
different LSMs we will need some additional work to ensure it is
handled properly, but I don't think we need to worry too much about
that now.

-- 
paul-moore.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ