lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 19 Mar 2023 15:36:39 +0200
From:   Jarkko Sakkinen <jarkko@...nel.org>
To:     Mark Hasemeyer <markhas@...omium.org>
Cc:     Jason Gunthorpe <jgg@...pe.ca>, Peter Huewe <peterhuewe@....de>,
        linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tpm: cr50: i2c: use jiffies to wait for tpm ready irq

On Tue, Mar 14, 2023 at 01:54:04PM -0600, Mark Hasemeyer wrote:
> When waiting for a tpm ready completion, the cr50 i2c driver incorrectly
> assumes that the value of timeout_a is represented in milliseconds
> instead of jiffies.
> 
> Remove the msecs_to_jiffies conversion.
> 
> Signed-off-by: Mark Hasemeyer <markhas@...omium.org>
> ---
> 
>  drivers/char/tpm/tpm_tis_i2c_cr50.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c
> index 77cea5b31c6e4..376ae18a04ebb 100644
> --- a/drivers/char/tpm/tpm_tis_i2c_cr50.c
> +++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c
> @@ -100,8 +100,7 @@ static int tpm_cr50_i2c_wait_tpm_ready(struct tpm_chip *chip)
>  	}
>  
>  	/* Wait for interrupt to indicate TPM is ready to respond */
> -	if (!wait_for_completion_timeout(&priv->tpm_ready,
> -					 msecs_to_jiffies(chip->timeout_a))) {
> +	if (!wait_for_completion_timeout(&priv->tpm_ready, chip->timeout_a)) {
>  		dev_warn(&chip->dev, "Timeout waiting for TPM ready\n");
>  		return -ETIMEDOUT;
>  	}
> -- 
> 2.40.0.rc2.332.ga46443480c-goog
> 

Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ