Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 9 Aug 2016 10:02:35 -0700
From: Thomas Garnier <thgarnie@...gle.com>
To: Borislav Petkov <bp@...e.de>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, 
	"H . Peter Anvin" <hpa@...or.com>, Joerg Roedel <jroedel@...e.de>, Dave Young <dyoung@...hat.com>, 
	"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>, Lv Zheng <lv.zheng@...el.com>, 
	Baoquan He <bhe@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>, 
	Mark Salter <msalter@...hat.com>, Aleksey Makarov <aleksey.makarov@...aro.org>, 
	Kees Cook <keescook@...omium.org>, Andrew Morton <akpm@...ux-foundation.org>, 
	Christian Borntraeger <borntraeger@...ibm.com>, Fabian Frederick <fabf@...net.be>, Toshi Kani <toshi.kani@...com>, 
	Dan Williams <dan.j.williams@...el.com>, "the arch/x86 maintainers" <x86@...nel.org>, 
	LKML <linux-kernel@...r.kernel.org>, 
	Kernel Hardening <kernel-hardening@...ts.openwall.com>
Subject: Re: [PATCH v2 2/2] x86/KASLR: Increase BRK pages for KASLR memory randomization

On Tue, Aug 9, 2016 at 9:54 AM, Borislav Petkov <bp@...e.de> wrote:
> On Tue, Aug 09, 2016 at 09:35:54AM -0700, Thomas Garnier wrote:
>> Default implementation expects 6 pages maximum are needed for low page
>> allocations. If KASLR memory randomization is enabled, the worse case
>> of e820 layout would require 12 pages (no large pages). It is due to the
>> PUD level randomization and the variable e820 memory layout.
>>
>> This bug was found while doing extensive testing of KASLR memory
>> randomization on different type of hardware.
>>
>> Fixes: 021182e52fe0 ("Enable KASLR for physical mapping memory regions")
>> Signed-off-by: Thomas Garnier <thgarnie@...gle.com>
>> ---
>> Based on next-20160805
>> ---
>>  arch/x86/mm/init.c | 14 ++++++++++++--
>>  1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
>> index 6209289..796e7af 100644
>> --- a/arch/x86/mm/init.c
>> +++ b/arch/x86/mm/init.c
>> @@ -122,8 +122,18 @@ __ref void *alloc_low_pages(unsigned int num)
>>       return __va(pfn << PAGE_SHIFT);
>>  }
>>
>> -/* need 3 4k for initial PMD_SIZE,  3 4k for 0-ISA_END_ADDRESS */
>> -#define INIT_PGT_BUF_SIZE    (6 * PAGE_SIZE)
>> +/*
>> + * By default need 3 4k for initial PMD_SIZE,  3 4k for 0-ISA_END_ADDRESS.
>> + * With KASLR memory randomization, depending on the machine e860 memory layout
>> + * and the PUD alignement. We may need twice more pages when KASLR memoy
>> + * randomization is enabled.
>
> Can you please integrate all review feedback before you send your next
> versions?
>
> There's no "e860" thing and
> s/memoy/memory/ and
> s/alignement/alignment/
>
> IOW, just integrate a spellchecker into your workflow.

Will do, thanks.

>
> Thanks.
>
> --
> Regards/Gruss,
>     Boris.
>
> ECO tip #101: Trim your mails when you reply.
>
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
> --

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.