[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d923917cfd387cbf275eece78406f9ad07e6d0d3.camel@linux.ibm.com>
Date: Mon, 11 Mar 2024 08:19:56 -0400
From: Mimi Zohar <zohar@...ux.ibm.com>
To: Roberto Sassu <roberto.sassu@...weicloud.com>, corbet@....net,
dmitry.kasatkin@...il.com, eric.snowberg@...cle.com,
paul@...l-moore.com, jmorris@...ei.org, serge@...lyn.com
Cc: linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-integrity@...r.kernel.org, linux-security-module@...r.kernel.org,
wufan@...ux.microsoft.com, pbrobinson@...il.com, zbyszek@...waw.pl,
hch@....de, mjg59@...f.ucam.org, pmatilai@...hat.com, jannh@...gle.com,
dhowells@...hat.com, jikos@...nel.org, mkoutny@...e.com,
ppavlu@...e.com, petr.vorel@...il.com, petrtesarik@...weicloud.com,
mzerqung@...inter.de, kgold@...ux.ibm.com,
Roberto Sassu <roberto.sassu@...wei.com>
Subject: Re: [RFC][PATCH 8/8] ima: Detect if digest cache changed since last
measurement/appraisal
On Mon, 2024-03-11 at 10:11 +0100, Roberto Sassu wrote:
>
> > > @@ -386,8 +402,6 @@ static int process_measurement(struct file *file,
> > > const
> > > struct cred *cred,
> > > if (verif_mask_ptr)
> > > allow_mask = policy_mask & *verif_mask_ptr;
> > > }
> > > -
> > > - digest_cache_put(digest_cache);
> >
> > Keeping a reference to the digest_cache list for each file in the iint cache
> > until the file is re-accessed, might take a while to free.
>
> Yes, that is the drawback...
>
> > I'm wondering if it necessary to keep a reference to the digest_cache. Or
> > is it
> > possible to just compare the existing iint->digest_cache pointer with the
> > current digest_cache pointer?
>
> If the pointer value is the same, it does not guarantee that it is the
> same digest cache used for the previous verification. It might have
> been freed and reallocated.
Agreed.
>
> Maybe, if the digest_cache LSM is able to notify to IMA that the digest
> cache changed, so that IMA resets its flags in the integrity metadata,
> we would not need to pin it.
Yes, something similar to the "ima_lsm_policy_notifier".
Mimi
Powered by blists - more mailing lists