linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] tpm: Don't make log failures fatal
@ 2020-01-02 21:55 Matthew Garrett
  2020-01-03 19:09 ` Jerry Snitselaar
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Matthew Garrett @ 2020-01-02 21:55 UTC (permalink / raw)
  To: linux-integrity; +Cc: Jarkko Sakkinen, Matthew Garrett, Matthew Garrett, stable

If a TPM is in disabled state, it's reasonable for it to have an empty
log. Bailing out of probe in this case means that the PPI interface
isn't available, so there's no way to then enable the TPM from the OS.
In general it seems reasonable to ignore log errors - they shouldn't
interfere with any other TPM functionality.

Signed-off-by: Matthew Garrett <mjg59@google.com>
Cc: stable@vger.kernel.org
---

V2: make tpm_bios_log_setup() void, since we're not using the return
code now. Fix typo in patch description.

 drivers/char/tpm/eventlog/common.c | 12 ++++--------
 drivers/char/tpm/tpm-chip.c        |  4 +---
 drivers/char/tpm/tpm.h             |  2 +-
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/char/tpm/eventlog/common.c b/drivers/char/tpm/eventlog/common.c
index 7a0fca659b6a6..7460f230bae4c 100644
--- a/drivers/char/tpm/eventlog/common.c
+++ b/drivers/char/tpm/eventlog/common.c
@@ -99,11 +99,8 @@ static int tpm_read_log(struct tpm_chip *chip)
  *
  * If an event log is found then the securityfs files are setup to
  * export it to userspace, otherwise nothing is done.
- *
- * Returns -ENODEV if the firmware has no event log or securityfs is not
- * supported.
  */
-int tpm_bios_log_setup(struct tpm_chip *chip)
+void tpm_bios_log_setup(struct tpm_chip *chip)
 {
 	const char *name = dev_name(&chip->dev);
 	unsigned int cnt;
@@ -112,7 +109,7 @@ int tpm_bios_log_setup(struct tpm_chip *chip)
 
 	rc = tpm_read_log(chip);
 	if (rc < 0)
-		return rc;
+		return;
 	log_version = rc;
 
 	cnt = 0;
@@ -158,13 +155,12 @@ int tpm_bios_log_setup(struct tpm_chip *chip)
 		cnt++;
 	}
 
-	return 0;
+	return;
 
 err:
-	rc = PTR_ERR(chip->bios_dir[cnt]);
 	chip->bios_dir[cnt] = NULL;
 	tpm_bios_log_teardown(chip);
-	return rc;
+	return;
 }
 
 void tpm_bios_log_teardown(struct tpm_chip *chip)
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index 3d6d394a86618..58073836b5555 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -596,9 +596,7 @@ int tpm_chip_register(struct tpm_chip *chip)
 
 	tpm_sysfs_add_device(chip);
 
-	rc = tpm_bios_log_setup(chip);
-	if (rc != 0 && rc != -ENODEV)
-		return rc;
+	tpm_bios_log_setup(chip);
 
 	tpm_add_ppi(chip);
 
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index b9e1547be6b51..1df2cf40ab794 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -236,7 +236,7 @@ int tpm2_prepare_space(struct tpm_chip *chip, struct tpm_space *space, u8 *cmd,
 int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space, void *buf,
 		      size_t *bufsiz);
 
-int tpm_bios_log_setup(struct tpm_chip *chip);
+void tpm_bios_log_setup(struct tpm_chip *chip);
 void tpm_bios_log_teardown(struct tpm_chip *chip);
 int tpm_dev_common_init(void);
 void tpm_dev_common_exit(void);
-- 
2.24.1.735.g03f4e72817-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] tpm: Don't make log failures fatal
  2020-01-02 21:55 [PATCH V2] tpm: Don't make log failures fatal Matthew Garrett
@ 2020-01-03 19:09 ` Jerry Snitselaar
  2020-01-03 22:53 ` Jarkko Sakkinen
       [not found] ` <20200104053108.B393D2071A@mail.kernel.org>
  2 siblings, 0 replies; 7+ messages in thread
From: Jerry Snitselaar @ 2020-01-03 19:09 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-integrity, Jarkko Sakkinen, Matthew Garrett, stable

On Thu Jan 02 20, Matthew Garrett wrote:
>If a TPM is in disabled state, it's reasonable for it to have an empty
>log. Bailing out of probe in this case means that the PPI interface
>isn't available, so there's no way to then enable the TPM from the OS.
>In general it seems reasonable to ignore log errors - they shouldn't
>interfere with any other TPM functionality.
>
>Signed-off-by: Matthew Garrett <mjg59@google.com>
>Cc: stable@vger.kernel.org
>---

Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] tpm: Don't make log failures fatal
  2020-01-02 21:55 [PATCH V2] tpm: Don't make log failures fatal Matthew Garrett
  2020-01-03 19:09 ` Jerry Snitselaar
@ 2020-01-03 22:53 ` Jarkko Sakkinen
  2020-02-20 20:29   ` Matthew Garrett
       [not found] ` <20200104053108.B393D2071A@mail.kernel.org>
  2 siblings, 1 reply; 7+ messages in thread
From: Jarkko Sakkinen @ 2020-01-03 22:53 UTC (permalink / raw)
  To: Matthew Garrett, linux-integrity; +Cc: Matthew Garrett, stable

On Thu, 2020-01-02 at 13:55 -0800, Matthew Garrett wrote:
> If a TPM is in disabled state, it's reasonable for it to have an empty
> log. Bailing out of probe in this case means that the PPI interface
> isn't available, so there's no way to then enable the TPM from the OS.
> In general it seems reasonable to ignore log errors - they shouldn't
> interfere with any other TPM functionality.
> 
> Signed-off-by: Matthew Garrett <mjg59@google.com>
> Cc: stable@vger.kernel.org

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] tpm: Don't make log failures fatal
       [not found] ` <20200104053108.B393D2071A@mail.kernel.org>
@ 2020-02-20 20:22   ` Matthew Garrett
  2020-02-25 10:42     ` Jarkko Sakkinen
  0 siblings, 1 reply; 7+ messages in thread
From: Matthew Garrett @ 2020-02-20 20:22 UTC (permalink / raw)
  To: Sasha Levin; +Cc: linux-integrity, Jarkko Sakkinen, stable

On Fri, Jan 3, 2020 at 9:31 PM Sasha Levin <sashal@kernel.org> wrote:
>
> The bot has tested the following trees: v5.4.7, v5.3.18, v4.19.92, v4.14.161, v4.9.207, v4.4.207.
> v4.14.161: Failed to apply! Possible dependencies:
> v4.9.207: Failed to apply! Possible dependencies:
> v4.4.207: Failed to apply! Possible dependencies:
> How should we proceed with this patch?

Ignoring these kernels should be fine.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] tpm: Don't make log failures fatal
  2020-01-03 22:53 ` Jarkko Sakkinen
@ 2020-02-20 20:29   ` Matthew Garrett
  2020-02-20 22:26     ` Jarkko Sakkinen
  0 siblings, 1 reply; 7+ messages in thread
From: Matthew Garrett @ 2020-02-20 20:29 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: linux-integrity, stable

On Fri, Jan 3, 2020 at 3:26 PM Jarkko Sakkinen
<jarkko.sakkinen@linux.intel.com> wrote:
>
> On Thu, 2020-01-02 at 13:55 -0800, Matthew Garrett wrote:
> > If a TPM is in disabled state, it's reasonable for it to have an empty
> > log. Bailing out of probe in this case means that the PPI interface
> > isn't available, so there's no way to then enable the TPM from the OS.
> > In general it seems reasonable to ignore log errors - they shouldn't
> > interfere with any other TPM functionality.
> >
> > Signed-off-by: Matthew Garrett <mjg59@google.com>
> > Cc: stable@vger.kernel.org
>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Hi Jarkko,

Is this queued anywhere? Thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] tpm: Don't make log failures fatal
  2020-02-20 20:29   ` Matthew Garrett
@ 2020-02-20 22:26     ` Jarkko Sakkinen
  0 siblings, 0 replies; 7+ messages in thread
From: Jarkko Sakkinen @ 2020-02-20 22:26 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-integrity, stable

On Thu, Feb 20, 2020 at 12:29:24PM -0800, Matthew Garrett wrote:
> On Fri, Jan 3, 2020 at 3:26 PM Jarkko Sakkinen
> <jarkko.sakkinen@linux.intel.com> wrote:
> >
> > On Thu, 2020-01-02 at 13:55 -0800, Matthew Garrett wrote:
> > > If a TPM is in disabled state, it's reasonable for it to have an empty
> > > log. Bailing out of probe in this case means that the PPI interface
> > > isn't available, so there's no way to then enable the TPM from the OS.
> > > In general it seems reasonable to ignore log errors - they shouldn't
> > > interfere with any other TPM functionality.
> > >
> > > Signed-off-by: Matthew Garrett <mjg59@google.com>
> > > Cc: stable@vger.kernel.org
> >
> > Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> 
> Hi Jarkko,
> 
> Is this queued anywhere? Thanks!

Thanks for reminding. Now is:

git://git.infradead.org/users/jjs/linux-tpmdd.git

/Jarkko

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] tpm: Don't make log failures fatal
  2020-02-20 20:22   ` Matthew Garrett
@ 2020-02-25 10:42     ` Jarkko Sakkinen
  0 siblings, 0 replies; 7+ messages in thread
From: Jarkko Sakkinen @ 2020-02-25 10:42 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: Sasha Levin, linux-integrity, stable

On Thu, Feb 20, 2020 at 12:22:44PM -0800, Matthew Garrett wrote:
> On Fri, Jan 3, 2020 at 9:31 PM Sasha Levin <sashal@kernel.org> wrote:
> >
> > The bot has tested the following trees: v5.4.7, v5.3.18, v4.19.92, v4.14.161, v4.9.207, v4.4.207.
> > v4.14.161: Failed to apply! Possible dependencies:
> …
> > v4.9.207: Failed to apply! Possible dependencies:
> …
> > v4.4.207: Failed to apply! Possible dependencies:
> …
> > How should we proceed with this patch?
> 
> Ignoring these kernels should be fine.

Please, (sanity) check:

  git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Modified the commit message:

  Cc: stable@vger.kernel.org # 4.19.x

/Jarkko

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-02-25 10:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-02 21:55 [PATCH V2] tpm: Don't make log failures fatal Matthew Garrett
2020-01-03 19:09 ` Jerry Snitselaar
2020-01-03 22:53 ` Jarkko Sakkinen
2020-02-20 20:29   ` Matthew Garrett
2020-02-20 22:26     ` Jarkko Sakkinen
     [not found] ` <20200104053108.B393D2071A@mail.kernel.org>
2020-02-20 20:22   ` Matthew Garrett
2020-02-25 10:42     ` Jarkko Sakkinen

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).