Use GRND_INSECURE flag for linux_trng_adapter
In some test cases the getrandom() syscall is used to retrieve random
numbers generated by the Linux kernel's builtin crng. Currently this
syscall can block for a long time while waiting for enough available
entropy to generate cryptographically safe random numbers. The waiting
time significantly increased from kernel v5.16 to v6.1 (probably related
to the rng developments in v5.17 and v5.18 [1]) and now causes timeout
errors in the CI for some tests.
This commit solves the issue by adding the GRND_INSECURE flag so the
syscall will return data even when there isn't enough entropy available.
As a side effect this means we get possibly cryptographically insecure
random numbers, but for testing purposes this shouldn't be a problem.
Link: [1] https://www.zx2c4.com/projects/linux-rng-5.17-5.18
Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
Change-Id: Icd09414d79b798805869d3a00e32e843d6c245e6
1 file changed