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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 14 Oct 2019 13:27:32 +0100
From:   Daniel Thompson <daniel.thompson@...aro.org>
To:     Sumit Garg <sumit.garg@...aro.org>
Cc:     linux-crypto@...r.kernel.org, dsaxena@...xity.net,
        herbert@...dor.apana.org.au, mpm@...enic.com,
        romain.perier@...e-electrons.com, arnd@...db.de,
        gregkh@...uxfoundation.org, ralph.siemsen@...aro.org,
        milan.stevanovic@...com, ryan.harkin@...aro.org,
        linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] hwrng: omap - Fix RNG wait loop timeout

On Mon, Oct 14, 2019 at 05:32:45PM +0530, Sumit Garg wrote:
> Existing RNG data read timeout is 200us but it doesn't cover EIP76 RNG
> data rate which takes approx. 700us to produce 16 bytes of output data
> as per testing results. So configure the timeout as 1000us to also take
> account of lack of udelay()'s reliability.

What "lack of udelay()'s reliability" are you concerned about?


Daniel.

> 
> Fixes: 383212425c92 ("hwrng: omap - Add device variant for SafeXcel IP-76 found in Armada 8K")
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Sumit Garg <sumit.garg@...aro.org>
> ---
>  drivers/char/hw_random/omap-rng.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
> index b27f396..e329f82 100644
> --- a/drivers/char/hw_random/omap-rng.c
> +++ b/drivers/char/hw_random/omap-rng.c
> @@ -66,6 +66,13 @@
>  #define OMAP4_RNG_OUTPUT_SIZE			0x8
>  #define EIP76_RNG_OUTPUT_SIZE			0x10
>  
> +/*
> + * EIP76 RNG takes approx. 700us to produce 16 bytes of output data
> + * as per testing results. And to account for the lack of udelay()'s
> + * reliability, we keep the timeout as 1000us.
> + */
> +#define RNG_DATA_FILL_TIMEOUT			100
> +
>  enum {
>  	RNG_OUTPUT_0_REG = 0,
>  	RNG_OUTPUT_1_REG,
> @@ -176,7 +183,7 @@ static int omap_rng_do_read(struct hwrng *rng, void *data, size_t max,
>  	if (max < priv->pdata->data_size)
>  		return 0;
>  
> -	for (i = 0; i < 20; i++) {
> +	for (i = 0; i < RNG_DATA_FILL_TIMEOUT; i++) {
>  		present = priv->pdata->data_present(priv);
>  		if (present || !wait)
>  			break;
> -- 
> 2.7.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ