Re: [PATCH] hwrng: core - Fix use-after-free warning in hwrng_register()

2019-10-18 Thread Herbert Xu
On Mon, Oct 14, 2019 at 01:46:32PM +0200, Laurent Vivier wrote: > Commit daae28debcb0 has moved add_early_randomness() out of the > rng_mutex and tries to protect the reference of the new rng device > by incrementing the reference counter. > > But in hwrng_register(), the function can be called wi

[PATCH] hwrng: core - Fix use-after-free warning in hwrng_register()

2019-10-14 Thread Laurent Vivier
Commit daae28debcb0 has moved add_early_randomness() out of the rng_mutex and tries to protect the reference of the new rng device by incrementing the reference counter. But in hwrng_register(), the function can be called with a new device that is not set as the current_rng device and the referenc