]> 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, 23 Sep 2011 05:15:03 +0000 (15:15 +1000)
commitbae143ab36ab34ded95a4a87d79f3f3fb8286a16
treeed3728b346b7132bad8b664f25127061d8393f4b
parent838962e07c2a9f7897d963cd0515ad917eb0ac3e
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