linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Romain Naour <romain.naour@smile.fr>,
	Paul Menzel <pmenzel@molgen.mpg.de>
Cc: linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org, serge@hallyn.com,
	jmorris@namei.org, paul@paul-moore.com, eric.snowberg@oracle.com,
	dmitry.kasatkin@gmail.com, roberto.sassu@huawei.com,
	Romain Naour <romain.naour@skf.com>
Subject: Re: [RFC] integrity: wait for completion of i2c initialization using late_initcall_sync()
Date: Tue, 06 Aug 2024 20:41:22 -0400	[thread overview]
Message-ID: <80af3c293db64365bdadbec122c37de7194fbf51.camel@linux.ibm.com> (raw)
In-Reply-To: <785b9c89-a9a6-427d-8715-110cb638b645@smile.fr>

On Thu, 2024-08-01 at 12:12 +0200, Romain Naour wrote:
> Hi Mimi,
> 
> Le 11/07/2024 à 16:06, Mimi Zohar a écrit :
> > On Mon, 2024-07-01 at 22:37 -0400, Mimi Zohar wrote:
> > > Hi Romain,
> > > 
> > > Please limit the subject line to 70 - 75 characters.
> > > 
> > > 
> > > On Mon, 2024-07-01 at 16:58 +0200, Romain Naour wrote:
> > > > > > [1]
> > > > > > https://lore.kernel.org/linux-integrity/9b98d912-ba78-402c-a5c8-154bef8794f7@smile.fr/
> > > > > > [2]
> > > > > > https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1375425/tda4vm-ima-vs-tpm-builtin-driver-boot-order
> > > > > > 
> > > > > > Signed-off-by: Romain Naour <romain.naour@skf.com>
> > > > > 
> > > > > Should this get a Fixes: tag and be also applied to the stable series?
> > > > 
> > > > The current behavior can be reproduced on any released kernel (at least since
> > > > 6.1). But I'm not sure if it should be backported to stable kernels since it
> > > > delays the ima/evm initialization at runtime.
> > > 
> > > With the IMA builtin measurement policy specified on the boot command line
> > > ("ima_policy=tcb"), moving init_ima from the late_initcall() to
> > > late_initcall_sync() affects the measurement list order.  It's unlikely, but
> > > possible, that someone is sealing the TPM to PCR-10.  It's probably not a good
> > > idea to backport the change.
> > > 
> > > An alternative would be to continue using the late_initcall(), but retry on
> > > failure, instead of going directly into TPM-bypass mode.
> 
> Indeed, it would be better if the IMA (and EVM) can use something like EPROBE_DEFER.

Yes, "something like EPROBE_DEFER" sounds like the right direction.  Depending
on the environment, the TPM initialization delay might be acceptable and not
introduce an integrity gap.

For now let's start with just late_initcall() and late_initcall_sync().  If the
TPM hasn't been initialized, not all of ima_init() needs to be deferred to
late_initcall_sync().

> 
> > > 
> > > As far as I can tell, everything is still being measured and verified, but more
> > > testing is required.
> 
> Agree, I'm still evaluating the TPM stack when time allows.
> 
> > 
> > Romain, Paul, another report of IMA going into TPM-bypass mode is here: 
> > https://github.com/raspberrypi/linux/issues/6217.  Deferring IMA initialization
> > to late_initcall_sync() did not resolve the problem for them.  Please take a
> > look at the report.
> 
> I don't think that the "mdelay(200)" is really needed when late_initcall_sync()
> is used. I guess the issue was the spi driver was not builtin, fixed by:
> 
> CONFIG_SPI_DESIGNWARE=y
> CONFIG_SPI_DW_MMIO=y

Good to know.

thanks,

Mimi

  reply	other threads:[~2024-08-07  1:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 13:38 [RFC] integrity: wait for completion of i2c initialization using late_initcall_sync() Romain Naour
2024-07-01 13:53 ` Paul Menzel
2024-07-01 14:58   ` Romain Naour
2024-07-02  2:37     ` Mimi Zohar
2024-07-11 14:06       ` Mimi Zohar
2024-08-01 10:12         ` Romain Naour
2024-08-07  0:41           ` Mimi Zohar [this message]
2024-08-16 12:46             ` Roberto Sassu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80af3c293db64365bdadbec122c37de7194fbf51.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=eric.snowberg@oracle.com \
    --cc=jmorris@namei.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=roberto.sassu@huawei.com \
    --cc=romain.naour@skf.com \
    --cc=romain.naour@smile.fr \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).