[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8dd7b018-7f17-0018-0fcf-d0257976d275@ghiti.fr>
Date: Thu, 25 Jul 2019 07:48:44 +0200
From: Alexandre Ghiti <alex@...ti.fr>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: Albert Ou <aou@...s.berkeley.edu>,
Kees Cook <keescook@...omium.org>,
Catalin Marinas <catalin.marinas@....com>,
Palmer Dabbelt <palmer@...ive.com>,
Will Deacon <will.deacon@....com>,
Russell King <linux@...linux.org.uk>,
Ralf Baechle <ralf@...ux-mips.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Paul Burton <paul.burton@...s.com>,
linux-riscv@...ts.infradead.org,
Alexander Viro <viro@...iv.linux.org.uk>,
James Hogan <jhogan@...nel.org>, linux-fsdevel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
linux-mips@...r.kernel.org, Christoph Hellwig <hch@....de>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH REBASE v4 05/14] arm64, mm: Make randomization selected by
generic topdown mmap layout
On 7/24/19 7:11 PM, Luis Chamberlain wrote:
> On Wed, Jul 24, 2019 at 01:58:41AM -0400, Alexandre Ghiti wrote:
>> diff --git a/mm/util.c b/mm/util.c
>> index 0781e5575cb3..16f1e56e2996 100644
>> --- a/mm/util.c
>> +++ b/mm/util.c
>> @@ -321,7 +321,15 @@ unsigned long randomize_stack_top(unsigned long stack_top)
>> }
>>
>> #ifdef CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
>> -#ifdef CONFIG_ARCH_HAS_ELF_RANDOMIZE
>> +unsigned long arch_randomize_brk(struct mm_struct *mm)
>> +{
>> + /* Is the current task 32bit ? */
>> + if (!IS_ENABLED(CONFIG_64BIT) || is_compat_task())
>> + return randomize_page(mm->brk, SZ_32M);
>> +
>> + return randomize_page(mm->brk, SZ_1G);
>> +}
>> +
>> unsigned long arch_mmap_rnd(void)
>> {
>> unsigned long rnd;
>> @@ -335,7 +343,6 @@ unsigned long arch_mmap_rnd(void)
>>
>> return rnd << PAGE_SHIFT;
>> }
> So arch_randomize_brk is no longer ifdef'd around
> CONFIG_ARCH_HAS_ELF_RANDOMIZE either and yet the header
> still has it. Is that intentional?
>
Yes, CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT selects
CONFIG_ARCH_HAS_ELF_RANDOMIZE, that's what's new about v4: the generic
functions proposed in this series come with elf randomization.
Alex
> Luis
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
Powered by blists - more mailing lists