Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 0768ae32 authored by Eric Biggers's avatar Eric Biggers
Browse files

ANDROID: allow add_hwgenerator_randomness() from non-kthread



A recent LTS change causes add_hwgenerator_randomness() to crash when
called from a non-kthread task.  This shouldn't be a problem, since this
function should only be called by the HWRNG framework.  However, on this
branch it is part of the KMI since a vendor module is using it
inappropriately by calling it during early init.  (Note that
add_bootloader_randomness() would be a better fit for the use case.)

To prevent a crash in this case, restore support for
add_hwgenerator_randomness() being called from a non-kthread task.

This change isn't currently needed in 5.4 or newer kernels, as
add_hwgenerator_randomness() isn't part of the KMI there.

Bug: 238701371
Fixes: 8bc7018f ("random: do not use batches when !crng_ready()")
Change-Id: I0b86743deb30f54b8f838a36eea740b370a30a8b
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
parent 79651a7a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment