[lvc-project] [PATCH] crypto: drbg - simplify drbg_get_random_bytes()
Herbert Xu
herbert at gondor.apana.org.au
Sat Nov 22 05:02:38 MSK 2025
On Sat, Nov 15, 2025 at 11:45:12PM +0300, Sergey Shtylyov wrote:
> To begin with, drbg_fips_continuous_test() only returns 0 and -EAGAIN,
> so an early return from the *do/while* loop in drbg_get_random_bytes()
> just isn't possible. Then, the loop condition needs to be adjusted to
> only continue the loop while -EAGAIN is returned and the final *return*
> statement needs to be adjusted as well, in order to be prepared for the
> case of drbg_fips_continuous_test() starting to return some other error
> codes...
>
> Found by Linux Verification Center (linuxtesting.org) with the Svace static
> analysis tool.
>
> Suggested-by: Yann Droneaud <yann at droneaud.fr>
> Signed-off-by: Sergey Shtylyov <s.shtylyov at omp.ru>
>
> ---
> The patch is against the master branch of Herbert Xu's cryptodev-2.6.git repo.
https://lore.kernel.org/linux-crypto/aNH49MZHzZNOGSID@gondor.apana.org.au/
Cheers,
--
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
More information about the lvc-project
mailing list