android_kernel_oneplus_msm8998/include
dcashman 06bfe14bdd FROMLIST: drivers: char: random: add get_random_long()
(cherry picked from commit https://lkml.org/lkml/2016/2/4/831)

d07e22597d1d355 ("mm: mmap: add new /proc tunable for mmap_base ASLR")
added the ability to choose from a range of values to use for entropy
count in generating the random offset to the mmap_base address.  The
maximum value on this range was set to 32 bits for 64-bit x86 systems, but
this value could be increased further, requiring more than the 32 bits of
randomness provided by get_random_int(), as is already possible for arm64.
Add a new function: get_random_long() which more naturally fits with the
mmap usage of get_random_int() but operates exactly the same as
get_random_int().

Also, fix the shifting constant in mmap_rnd() to be an unsigned long so
that values greater than 31 bits generate an appropriate mask without
overflow.  This is especially important on x86, as its shift instruction
uses a 5-bit mask for the shift operand, which meant that any value for
mmap_rnd_bits over 31 acts as a no-op and effectively disables mmap_base
randomization.

Finally, replace calls to get_random_int() with get_random_long() where
appropriate.

Bug: 26963541
Signed-off-by: Daniel Cashman <dcashman@android.com>
Signed-off-by: Daniel Cashman <dcashman@google.com>
Change-Id: I5b45621088666d5d1dfbf43952f25ea0798b10ba
2016-04-07 16:49:59 +05:30
..
acpi Merge branch 'acpi-pci' 2015-11-07 01:30:10 +01:00
asm-generic This is the 4.4.5 stable release 2016-03-18 09:45:54 +00:00
clocksource
crypto crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path 2016-02-17 12:31:03 -08:00
drm drm: add helper to check for wc memory support 2016-03-03 15:07:21 -08:00
dt-bindings ARM: DT updates for v4.4 2015-11-10 15:06:26 -08:00
keys
kvm KVM: arm/arm64: arch_timer: Preserve physical dist. active state on LR.active 2015-11-24 18:07:40 +01:00
linux FROMLIST: drivers: char: random: add get_random_long() 2016-04-07 16:49:59 +05:30
math-emu
media
memory
misc
net net: diag: Support destroying TCP sockets. 2016-04-07 16:49:53 +05:30
pcmcia
ras
rdma IB/mad: Require CM send method for everything except ClassPortInfo 2015-12-08 12:19:11 -05:00
rxrpc
scsi Merge branch 'mkp-fixes' into fixes 2015-12-03 09:32:33 -08:00
soc ARM: SoC driver updates for v4.4 2015-11-10 15:00:03 -08:00
sound ALSA: rawmidi: Make snd_rawmidi_transmit() race-free 2016-02-17 12:30:58 -08:00
target target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors 2016-03-09 15:34:51 -08:00
trace trace: power: add trace_clock_set_parent 2016-02-16 13:53:31 -08:00
uapi net: diag: Add the ability to destroy a socket. 2016-04-07 16:49:53 +05:30
video video: adf: fbdev: add stubs for kernels without ADF_FBDEV 2016-02-16 13:53:22 -08:00
xen xen: Add RING_COPY_REQUEST() 2015-12-18 10:00:17 -05:00
Kbuild