Re: [PATCH] x86/elf: Correct comment for STACK_RND_MASK()

From: SJ Park

Date: Wed Jul 22 2026 - 20:34:06 EST


On Wed, 22 Jul 2026 19:44:43 +0100 "Lorenzo Stoakes (ARM)" <ljs@xxxxxxxxxx> wrote:

> Commit 913bd9060195 ("[PATCH] x86_64: Increase the variability of the
> process stack on 64bit architectures"), merged in 2006, increased stack
> randomisation from 8 MiB to an ostensible 1 GiB for 64-bit systems.
>
> However the commit actually introduced a mask of 0x3fffff * 4 KiB pages
> which provides 16 GiB of randomisation, not 1 GiB.
>
> It appears Andi perhaps typo'd an additional 'f', as 0x3ffff would indeed
> provide the stated 1 GiB.
>
> Since this value has been in use for 20 years it seems sensible to retain
> it, so correct the comment instead.

Good catch, and sounds reasonable fix to me.

>
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>

Acked-by: SJ Park <sj@xxxxxxxxxx>


Thanks,
SJ

[...]