android_kernel_google_msm/include
Daniel Borkmann 4dd7a52b53 random32: fix off-by-one in seeding requirement
[ Upstream commit 51c37a70aa ]

For properly initialising the Tausworthe generator [1], we have
a strict seeding requirement, that is, s1 > 1, s2 > 7, s3 > 15.

Commit 697f8d0348 ("random32: seeding improvement") introduced
a __seed() function that imposes boundary checks proposed by the
errata paper [2] to properly ensure above conditions.

However, we're off by one, as the function is implemented as:
"return (x < m) ? x + m : x;", and called with __seed(X, 1),
__seed(X, 7), __seed(X, 15). Thus, an unwanted seed of 1, 7, 15
would be possible, whereas the lower boundary should actually
be of at least 2, 8, 16, just as GSL does. Fix this, as otherwise
an initialization with an unwanted seed could have the effect
that Tausworthe's PRNG properties cannot not be ensured.

Note that this PRNG is *not* used for cryptography in the kernel.

 [1] http://www.iro.umontreal.ca/~lecuyer/myftp/papers/tausme.ps
 [2] http://www.iro.umontreal.ca/~lecuyer/myftp/papers/tausme2.ps

Joint work with Hannes Frederic Sowa.

Fixes: 697f8d0348 ("random32: seeding improvement")
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-08 07:29:41 -08:00
..
acpi
asm-generic mm: allow arch code to control the user page table ceiling 2013-05-07 19:51:55 -07:00
crypto
drm drm/radeon: add new richland pci ids 2013-05-11 13:48:14 -07:00
keys
linux random32: fix off-by-one in seeding requirement 2013-12-08 07:29:41 -08:00
math-emu
media media: v4l2: added missing mutex.h include to v4l2-ctrls.h 2013-09-26 17:15:49 -07:00
misc
mtd
net net: fix cipso packet validation when !NETLABEL 2013-11-04 04:23:41 -08:00
pcmcia
rdma infiniband: pass rdma_cm module to netlink_dump_start 2012-10-28 10:14:15 -07:00
rxrpc
scsi SCSI: libsas: fix taskfile corruption in sas_ata_qc_fill_rtf 2012-07-16 09:04:37 -07:00
sound ALSA: Add a reference counter to card instance 2012-11-17 13:16:13 -08:00
target target: Add link_magic for fabric allow_link destination target_items 2013-01-21 11:45:24 -08:00
trace tracing: Allow events to have NULL strings 2013-12-04 10:50:34 -08:00
video atmel_lcdfb: fix 16-bpp modes on older SOCs 2013-03-20 13:05:00 -07:00
xen xen/blkback: correctly respond to unknown, non-native requests 2013-04-05 10:04:18 -07:00
Kbuild