Re: [tip:x86/mm] x86: Fix mmap random address range

From: Valdis . Kletnieks
Date: Wed Dec 07 2011 - 07:30:23 EST


On Mon, 05 Dec 2011 09:52:17 PST, tip-bot for Ludwig Nussel said:
> Commit-ID: 9af0c7a6fa860698d080481f24a342ba74b68982
> Gitweb: http://git.kernel.org/tip/9af0c7a6fa860698d080481f24a342ba74b68982
> Author: Ludwig Nussel <ludwig.nussel@xxxxxxx>
> AuthorDate: Tue, 15 Nov 2011 14:46:46 -0800
> Committer: Ingo Molnar <mingo@xxxxxxx>
> CommitDate: Mon, 5 Dec 2011 17:07:23 +0100
>
> x86: Fix mmap random address range
>
> 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.

Will somebody please hand me a big dose of caffeine and explain to me
how the range could have been -255 to 255? -256 maybe, or -128 to 127,
but -255??!?

Attachment: pgp00000.pgp
Description: PGP signature