stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm: Don't make log failures fatal
@ 2019-12-13 22:57 Matthew Garrett
  2019-12-17 10:54 ` Jarkko Sakkinen
  2019-12-17 12:15 ` Paul Menzel
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew Garrett @ 2019-12-13 22:57 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
itnerfere with any other TPM functionality.

Signed-off-by: Matthew Garrett <mjg59@google.com>
Cc: stable@vger.kernel.org
---
 drivers/char/tpm/tpm-chip.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index 3d6d394a8661..58073836b555 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);
 
-- 
2.24.1.735.g03f4e72817-goog


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

* Re: [PATCH] tpm: Don't make log failures fatal
  2019-12-13 22:57 [PATCH] tpm: Don't make log failures fatal Matthew Garrett
@ 2019-12-17 10:54 ` Jarkko Sakkinen
  2019-12-17 12:15 ` Paul Menzel
  1 sibling, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2019-12-17 10:54 UTC (permalink / raw)
  To: Matthew Garrett, linux-integrity; +Cc: Matthew Garrett, stable

On Fri, 2019-12-13 at 14:57 -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
> itnerfere with any other TPM functionality.
> 
> Signed-off-by: Matthew Garrett <mjg59@google.com>
> Cc: stable@vger.kernel.org

Otherwise looks great but maybe it would make sense to change
tpm_bios_log_setup() as void as part of the change?

> ---
>  drivers/char/tpm/tpm-chip.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
> index 3d6d394a8661..58073836b555 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);
>  

/Jarkko


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

* Re: [PATCH] tpm: Don't make log failures fatal
  2019-12-13 22:57 [PATCH] tpm: Don't make log failures fatal Matthew Garrett
  2019-12-17 10:54 ` Jarkko Sakkinen
@ 2019-12-17 12:15 ` Paul Menzel
  2020-01-02 22:11   ` Matthew Garrett
  1 sibling, 1 reply; 4+ messages in thread
From: Paul Menzel @ 2019-12-17 12:15 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-integrity, Jarkko Sakkinen, Matthew Garrett, stable

Dear Matthew,


Am 13.12.19 um 23:57 schrieb Matthew Garrett:
> 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
> itnerfere with any other TPM functionality.

interfere

Can this be tested with QEMU somehow?

> Signed-off-by: Matthew Garrett <mjg59@google.com>
> Cc: stable@vger.kernel.org
> ---
>   drivers/char/tpm/tpm-chip.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
> index 3d6d394a8661..58073836b555 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);

Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul

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

* Re: [PATCH] tpm: Don't make log failures fatal
  2019-12-17 12:15 ` Paul Menzel
@ 2020-01-02 22:11   ` Matthew Garrett
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Garrett @ 2020-01-02 22:11 UTC (permalink / raw)
  To: Paul Menzel; +Cc: linux-integrity, Jarkko Sakkinen, stable

On Tue, Dec 17, 2019 at 4:15 AM Paul Menzel <pmenzel@molgen.mpg.de> wrote:
> Am 13.12.19 um 23:57 schrieb Matthew Garrett:
> > 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
> > itnerfere with any other TPM functionality.
>
> interfere
>
> Can this be tested with QEMU somehow?

I think you could hack ovmf to disable the event log, but I can't
think of a trivial test otherwise.

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

end of thread, other threads:[~2020-01-02 23:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13 22:57 [PATCH] tpm: Don't make log failures fatal Matthew Garrett
2019-12-17 10:54 ` Jarkko Sakkinen
2019-12-17 12:15 ` Paul Menzel
2020-01-02 22:11   ` Matthew Garrett

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