<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">As a temporary workaround, you might try defining __NR_getrandom to the appropriate system call number, although it looks like the extra efforts to get past the other preprocessor check ing rand_unit.c could get ugly.<div class=""><br class=""></div><div class="">What about defining your our getrandom function in your application that calls the system call?  The linker should find that before glibc’s.</div><div class=""><br class=""></div><div class=""><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>Pauli<br class="">-- <br class="">Dr Paul Dale | Distinguished Architect | Cryptographic Foundations <br class="">Phone +61 7 3031 7217<br class="">Oracle Australia</div><div><br class=""></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 12 Sep 2019, at 1:48 am, Michael Brunnbauer <<a href="mailto:brunni@netestate.de" class="">brunni@netestate.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class="">hi all,<br class=""><br class="">I have glibc 2.30 with Kernel 4.9.191 but unfortunately I compiled glibc with<br class="">old Kernel headers from Linux 3.16.46. It seems that as a result of this, my <br class="">getrandom() and getentropy() are stubs that always fail with ENOSYS. This <br class="">leads to:<br class=""><br class="">./util/shlib_wrap.sh apps/openssl rand -hex 10<br class="">4145686272:error:2406C06E:random number generator:RAND_DRBG_instantiate:error retrieving entropy:crypto/rand/drbg_lib.c:342:<br class="">...<br class=""><br class="">Fine I thought, supply --with-rand-seed=devrandom to Configure and be done<br class="">with it until you can fix your glibc. Nope - same result.<br class=""><br class="">Now I see this in e_os.h:<br class=""><br class="">/*<br class=""> * Linux kernels 4.8 and later changes how their random device works and there<br class=""> * is no reliable way to tell that /dev/urandom has been seeded -- getentropy(2)<br class=""> * should be used instead.<br class=""> */<br class="">#   ifndef DEVRANDOM_SAFE_KERNEL<br class="">#    define DEVRANDOM_SAFE_KERNEL        4, 8<br class="">#   endif<br class=""><br class="">So openSSL 1.1.1 will not support /dev/*random with Kernels > 4.8 ?<br class=""><br class="">I can fix the kernel headers before compiling the next release of glibc but<br class="">this is some months away.<br class=""><br class="">Is there anything I can do now? I don't like the idea to recompile glibc - <br class="">Version upgrades are much easier to deploy than replacing the current version.<br class=""><br class="">Regards,<br class=""><br class="">Michael Brunnbauer<br class=""><br class="">-- <br class="">++  Michael Brunnbauer<br class="">++  netEstate GmbH<br class="">++  Geisenhausener Straße 11a<br class="">++  81379 München<br class="">++  Tel +49 89 32 19 77 80<br class="">++  Fax +49 89 32 19 77 89 <br class="">++  <a href="mailto:brunni@netestate.de" class="">E-Mail brunni@netestate.de</a><br class="">++  <a href="https://www.netestate.de/" class="">https://www.netestate.de/</a><br class="">++<br class="">++  Sitz: München, HRB Nr.142452 (Handelsregister B München)<br class="">++  USt-IdNr. DE221033342<br class="">++  Geschäftsführer: Michael Brunnbauer, Franz Brunnbauer<br class="">++  Prokurist: Dipl. Kfm. (Univ.) Markus Hendel<br class=""></div></div></blockquote></div><br class=""></div></body></html>