Re: [PATCH] hwrng: core - reject unknown RNG names

From: Herbert Xu

Date: Fri Oct 02 2026 - 06:23:26 EST


On Thu, Sep 24, 2026 at 11:21:13PM +0200, Thorsten Blum wrote:
> In rng_current_store(), err is 0 after successfully locking rng_mutex,
> and if the requested RNG name cannot be found, the function reports
> success even though the current RNG was not changed.
>
> Set err = -ENODEV before searching the RNG list to reject unknown names.
>
> Fixes: 142a27f0a731 ("hwrng: core - Reset user selected rng by writing "" to rng_current")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
> ---
> drivers/char/hw_random/core.c | 1 +
> 1 file changed, 1 insertion(+)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt