1
0
Fork 0
alistair23-linux/include
Kees Cook f06295b44c ELF: implement AT_RANDOM for glibc PRNG seeding
While discussing[1] the need for glibc to have access to random bytes
during program load, it seems that an earlier attempt to implement
AT_RANDOM got stalled.  This implements a random 16 byte string, available
to every ELF program via a new auxv AT_RANDOM vector.

[1] http://sourceware.org/ml/libc-alpha/2008-10/msg00006.html

Ulrich said:

glibc needs right after startup a bit of random data for internal
protections (stack canary etc).  What is now in upstream glibc is that we
always unconditionally open /dev/urandom, read some data, and use it.  For
every process startup.  That's slow.

...

The solution is to provide a limited amount of random data to the
starting process in the aux vector.  I suggested 16 bytes and this is
what the patch implements.  If we need only 16 bytes or less we use the
data directly.  If we need more we'll use the 16 bytes to see a PRNG.
This avoids the costly /dev/urandom use and it allows the kernel to use
the most adequate source of random data for this purpose.  It might not
be the same pool as that for /dev/urandom.

Concerns were expressed about the depletion of the randomness pool.  But
this patch doesn't make the situation worse, it doesn't deplete entropy
more than happens now.

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:12 -08:00
..
acpi trivial: fix an -> a typos in documentation and comments 2009-01-06 11:28:07 +01:00
asm-arm [ARM] S3C24XX: Move mci.h to arch/arm/plat-s3c24xx/include/plat 2008-10-30 10:17:16 +00:00
asm-frv frv: introduce asm/swab.h 2009-01-06 18:10:28 -08:00
asm-generic remove linux/hardirq.h from asm-generic/local.h 2009-01-06 15:59:13 -08:00
asm-h8300
asm-m32r m32r: introduce asm/swab.h 2009-01-06 18:10:28 -08:00
asm-m68k m68k: introduce asm/swab.h 2009-01-06 18:10:27 -08:00
asm-mn10300 mn10300: introduce asm/swab.h 2009-01-06 18:10:29 -08:00
crypto crypto: aes - Precompute tables 2008-12-25 11:05:13 +11:00
drm drm: Add a debug node for vblank state. 2008-12-29 17:47:27 +10:00
keys KEYS: Disperse linux/key_ui.h 2008-11-14 10:39:13 +11:00
linux ELF: implement AT_RANDOM for glibc PRNG seeding 2009-01-08 08:31:12 -08:00
math-emu math-emu: Fix thinko in _FP_DIV 2008-10-22 22:09:59 -07:00
media V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
mtd trivial: fix then -> than typos in comments and documentation 2009-01-06 11:28:06 +01:00
net wimax: headers for kernel API and user space interaction 2009-01-07 10:00:16 -08:00
pcmcia
rdma
rxrpc
scsi [SCSI] fcoe: Fibre Channel over Ethernet 2008-12-29 11:24:33 -06:00
sound Merge branch 'topic/asoc' into for-linus 2009-01-06 09:48:51 +01:00
trace sched, trace: update trace_sched_wakeup() 2008-12-25 13:10:21 +01:00
video video: sh_mobile_lcdcfb deferred io support 2008-12-22 18:44:48 +09:00
xen xen: add xenfs to allow usermode <-> Xen interaction 2009-01-08 08:30:59 -08:00
Kbuild