]> git.kernelconcepts.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>
Mon, 19 Sep 2011 08:03:37 +0000 (18:03 +1000)
commit247bd322592c062bcb7b9ea17aafed1f5486ae55
tree54556c35fdc01ddc8d7cd060e7d3e37c9c41ba91
parent98d4c5ecc88cc7a9b68b4b61b7c2c1231a912596
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