mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] tpm/ppi: remove impossible assertion in tpm_eval_dsm
@ 2019-12-18 15:48 Aditya Pakki
  2019-12-19  0:05 ` Jarkko Sakkinen
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2019-12-18 15:48 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe,
	Arnd Bergmann, Greg Kroah-Hartman, linux-integrity, linux-kernel

In tpm_eval_dsm, BUG_ON on ppi_handle is used as an assertion.
However, if ppi_handle is NULL, the kernel crashes. The patch
removes the unnecessary check.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
v1: replaced the recovery code to completely eliminate the check,
as suggested by Jason Gunthorpe.
---
 drivers/char/tpm/tpm_ppi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
index b2dab941cb7f..603f7806f9af 100644
--- a/drivers/char/tpm/tpm_ppi.c
+++ b/drivers/char/tpm/tpm_ppi.c
@@ -42,7 +42,6 @@ static inline union acpi_object *
 tpm_eval_dsm(acpi_handle ppi_handle, int func, acpi_object_type type,
 	     union acpi_object *argv4, u64 rev)
 {
-	BUG_ON(!ppi_handle);
 	return acpi_evaluate_dsm_typed(ppi_handle, &tpm_ppi_guid,
 				       rev, func, argv4, type);
 }
-- 
2.20.1


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

* Re: [PATCH v2] tpm/ppi: remove impossible assertion in tpm_eval_dsm
  2019-12-18 15:48 [PATCH v2] tpm/ppi: remove impossible assertion in tpm_eval_dsm Aditya Pakki
@ 2019-12-19  0:05 ` Jarkko Sakkinen
  0 siblings, 0 replies; 2+ messages in thread
From: Jarkko Sakkinen @ 2019-12-19  0:05 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: kjlu, Peter Huewe, Jason Gunthorpe, Arnd Bergmann,
	Greg Kroah-Hartman, linux-integrity, linux-kernel

On Wed, 2019-12-18 at 09:48 -0600, Aditya Pakki wrote:
> In tpm_eval_dsm, BUG_ON on ppi_handle is used as an assertion.
> However, if ppi_handle is NULL, the kernel crashes. The patch
> removes the unnecessary check.
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
> v1: replaced the recovery code to completely eliminate the check,
> as suggested by Jason Gunthorpe.
> ---
>  drivers/char/tpm/tpm_ppi.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
> index b2dab941cb7f..603f7806f9af 100644
> --- a/drivers/char/tpm/tpm_ppi.c
> +++ b/drivers/char/tpm/tpm_ppi.c
> @@ -42,7 +42,6 @@ static inline union acpi_object *
>  tpm_eval_dsm(acpi_handle ppi_handle, int func, acpi_object_type type,
>  	     union acpi_object *argv4, u64 rev)
>  {
> -	BUG_ON(!ppi_handle);
>  	return acpi_evaluate_dsm_typed(ppi_handle, &tpm_ppi_guid,
>  				       rev, func, argv4, type);
>  }

Hmm.. maybe omitting completely is actually better idea (since
it never should happen anyway).

Lets go with that.

Thanks.

/Jarkko


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

end of thread, other threads:[~2019-12-19  0:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 15:48 [PATCH v2] tpm/ppi: remove impossible assertion in tpm_eval_dsm Aditya Pakki
2019-12-19  0:05 ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome