[PATCH] Add getrandom implementation [BZ #17252]

Florian Weimer fweimer@redhat.com
Thu Jun 23 17:21:00 GMT 2016


On 06/11/2016 12:15 AM, Roland McGrath wrote:
> You need to start with rationale justifying the new nonstandard API and why
> it belongs in libc,

Based on the last discussion, I assumed that we had consensus that we'd 
add wrappers for system calls which do not have merely niche applications.

There are about a dozen widely used cryptographic libraries on GNU/Linux 
which would use the system call to seed their PRNGs.  The /dev/urandom 
interface is considered insufficient, due to the boot-time 
initialization issue, and due to the potential unavailability of the 
device node.

In addition, many libraries need a one-time entropy source to initialize 
cookies (like our stack guard), or keys for randomized hash tables.

 > let alone why it should litter a POSIX-standard header.

We can certainly put into something like <sys/random.h>.

But if there is no consensus to evolve the Linux-specific glibc API, I 
don't know what to do.

getrandom support in glibc is requested rather often.  Here is a recent 
example:

   <https://www.python.org/dev/peps/pep-0522/>

Thanks,
Florian



More information about the Libc-alpha mailing list