]> git.karo-electronics.de Git - karo-tx-linux.git/commit
On x86_32 casting the unsigned int result of get_random_int() to long may
authorLudwig Nussel <ludwig.nussel@suse.de>
Sat, 16 Jul 2011 13:30:49 +0000 (23:30 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 26 Jul 2011 05:04:54 +0000 (15:04 +1000)
commitfec9b799f0758b04a4ae42609209b1913b109e38
tree09404f93288d1c9144fd70c9b9c6e4c293241a16
parentb1d5d6a3fc255c073f2a566a3d8e1df8b9f50f30
On x86_32 casting the unsigned int result of get_random_int() to long may
result in a negative value.  On x86_32 the range of mmap_rnd() therefore
was -255 to 255.  The 32bit mode on x86_64 used 0 to 255 as intended.

The bug was introduced by 675a081 ("x86: unify mmap_{32|64}.c") in January
2008.

Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/mm/mmap.c