]> 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, 3 Aug 2011 00:52:36 +0000 (10:52 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 17 Aug 2011 03:58:49 +0000 (13:58 +1000)
commitd20a9f43ce62d8f5f397489f40710f2f27ff20b5
tree44152e134dfc46902d35b819c96f146397cb6712
parent994e1c10d888a08a9a2889e830de732805c7ed11
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