[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220114104802.sap3rwuhtkui5ytr@wittgenstein>
Date: Fri, 14 Jan 2022 11:48:02 +0100
From: Christian Brauner <brauner@...nel.org>
To: Mimi Zohar <zohar@...ux.ibm.com>
Cc: Stefan Berger <stefanb@...ux.vnet.ibm.com>,
linux-integrity@...r.kernel.org, serge@...lyn.com,
christian.brauner@...ntu.com, containers@...ts.linux.dev,
dmitry.kasatkin@...il.com, ebiederm@...ssion.com,
krzysztof.struczynski@...wei.com, roberto.sassu@...wei.com,
mpeters@...hat.com, lhinds@...hat.com, lsturman@...hat.com,
puiterwi@...hat.com, jejb@...ux.ibm.com, jamjoom@...ibm.com,
linux-kernel@...r.kernel.org, paul@...l-moore.com, rgb@...hat.com,
linux-security-module@...r.kernel.org, jmorris@...ei.org,
Stefan Berger <stefanb@...ux.ibm.com>
Subject: Re: [PATCH v8 03/19] ima: Move policy related variables into
ima_namespace
On Thu, Jan 13, 2022 at 03:26:51PM -0500, Mimi Zohar wrote:
> Hi Stefan,
>
> On Tue, 2022-01-04 at 12:04 -0500, Stefan Berger wrote:
> > From: Stefan Berger <stefanb@...ux.ibm.com>
> >
> > Move variables related to the IMA policy into the ima_namespace. This way
> > the IMA policy of an IMA namespace can be set and displayed using a
> > front-end like SecurityFS.
> >
> > Implement ima_ns_from_file() to get the IMA namespace via the user
> > namespace of the SecurityFS superblock that a file belongs to.
> >
> > To get the current ima_namespace use get_current_ns() when a function
> > that is related to a policy rule is called. In other cases where functions
> > are called due file attribute modifications, use init_ima_ns, since these
> > functions are related to IMA appraisal and changes to file attributes are
> > only relevant to the init_ima_ns until IMA namespaces also support IMA
> > appraisal. In ima_file_free() use init_ima_ns since in this case flags
> > related to file measurements may be affected, which is not supported in
> > IMA namespaces, yet.
> >
> > Signed-off-by: Stefan Berger <stefanb@...ux.ibm.com>
>
> Please split this patch into "ima: pass through ima namespace", or some
> other name, and "ima: Move policy related variables into
> ima_namespace". The other option is to combine the "pass through ima
> namespace" with the 2nd patch, like Christian's example.
I was just about to comment something similar on 02/19.
I would also not introduce get_current_ns(). It's simply more honest and
if &init_ima_ns is used everywhere until multiple namespaces can
actually exists.
Powered by blists - more mailing lists