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:Eric Biggers <ebiggers@google.com>
Loading
Please register or sign in to comment