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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YnvTSqRgYkWu0qgp@kernel.org>
Date:   Wed, 11 May 2022 18:16:26 +0300
From:   Jarkko Sakkinen <jarkko@...nel.org>
To:     Johannes Holland <johannes.holland@...ineon.com>,
        Nayna <nayna@...ux.vnet.ibm.com>,
        Mimi Zohar <zohar@...ux.ibm.com>
Cc:     linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org,
        peterhuewe@....de, jgg@...pe.ca
Subject: Re: [PATCH] tpm: sleep at least <...> ms in tpm_msleep()

On Tue, May 10, 2022 at 01:29:03PM +0200, Johannes Holland wrote:
> To comply with protocol requirements, minimum polling times must often
> be adhered to. Therefore, a macro like tpm_msleep() should sleep at
> least the given amount of time (not up to the given period). Have
> tpm_msleep() sleep at least the given number of milliseconds.
> 
> Signed-off-by: Johannes Holland <johannes.holland@...ineon.com>
> ---
>  drivers/char/tpm/tpm.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index 2163c6ee0d36..0971b55fffe3 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -185,8 +185,8 @@ int tpm_pm_resume(struct device *dev);
>  
>  static inline void tpm_msleep(unsigned int delay_msec)
>  {
> -	usleep_range((delay_msec * 1000) - TPM_TIMEOUT_RANGE_US,
> -		     delay_msec * 1000);
> +	usleep_range(delay_msec * 1000, (delay_msec * 1000)
> +		     + TPM_TIMEOUT_RANGE_US);
>  };
>  
>  int tpm_chip_start(struct tpm_chip *chip);
> -- 
> 2.34.1
> 

For this I would really like to hear a 2nd opinion from Nayna and Mimi.

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ