Просмотр исходного кода

util-linux: avoid using the getrandom syscall

getrandom blocks until the random pool is being initialized.
Unfortunately, this code is being called early during init to create the
overlay filesystem, on some devices leaving little chance for a
successful random pool init.
True randomness is not that important here, so fix this issue by
sticking to using /dev/urandom, like in older versions of this code.

Signed-off-by: Felix Fietkau <[email protected]>
Felix Fietkau 8 лет назад
Родитель
Сommit
e64463ebde
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      package/utils/util-linux/patches/100-use_urandom.patch

+ 14 - 0
package/utils/util-linux/patches/100-use_urandom.patch

@@ -0,0 +1,14 @@
+--- a/lib/randutils.c
++++ b/lib/randutils.c
+@@ -25,6 +25,11 @@
+ #define THREAD_LOCAL static
+ #endif
+ 
++/* force /dev/urandom to avoid hanging on early boot */
++#undef HAVE_GETRANDOM
++#undef SYS_getrandom
++#undef __NR_getrandom
++
+ #ifdef HAVE_GETRANDOM
+ # include <sys/random.h>
+ #elif defined (__linux__)