BACKPORT: FROMLIST: mm: ASLR: use get_random_long()

(cherry picked from commit

Replace calls to get_random_int() followed by a cast to (unsigned long)
with calls to get_random_long().  Also address shifting bug which, in case
of x86 removed entropy mask for mmap_rnd_bits values > 31 bits.

Bug: 26963541
Signed-off-by: Daniel Cashman <>
Signed-off-by: Daniel Cashman <>
Change-Id: Ie577b21a0678cf4b21eae06bddd8ccb27cbe70ff
7 files changed