]> 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>
Wed, 24 Aug 2011 23:46:16 +0000 (09:46 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 9 Sep 2011 06:16:00 +0000 (16:16 +1000)
commite703596304923144c087a3256c51036a7e5659f4
tree107111f6f3f2055d0a3d4273fd0f324901aa7c07
parent11ffb6a1e0f8bec45bf8d3e48aafe0f17fe6a7cc
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