lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <5564344A.9060005@samsung.com>
Date:	Tue, 26 May 2015 11:52:26 +0300
From:	Andrey Ryabinin <a.ryabinin@...sung.com>
To:	Alexander Popov <alpopov@...ecurity.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrey Konovalov <adech.fo@...il.com>,
	Denys Vlasenko <dvlasenk@...hat.com>,
	Andy Lutomirski <luto@...capital.net>,
	Alexander Kuleshov <kuleshovmail@...il.com>,
	Sergey Kovalev <SKovalev@...ecurity.com>, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] x86_64: fix KASan shadow region page tables

On 05/25/2015 04:43 PM, Alexander Popov wrote:
> On 25.05.2015 11:12, Andrey Ryabinin wrote:
>> On 05/22/2015 07:03 PM, Alexander Popov wrote:
>>> Physical addresses in KASan shadow region page tables need fixup:
>>> kernel halts without it if phys_base is not zero.
>>>
>>
>> Indeed.
>> Since we have to patch page tables anyway, compile-time created kasan
>> page tables become pointless.
>> So, I'd suggest to create them in runtime. This could be done in plain C
>> in kasan_map_early_shadow().
>>
> 
> Thanks for your reply, Andrey.
> 
> Creating kasan_zero_pud, kasan_zero_pmd and kasan_zero_pte in
> kasan_map_early_shadow() doesn't look handy for me because this function
> is called twice in x86_64_start_kernel().
> 
> What do you think about leaving the initialization of KASan shadow region
> page tables in arch/x86/kernel/head_64.S and calling something like
> kasan_fixup_early_shadow() before calling kasan_map_early_shadow()
> for the first time?
> 

Why do we have initialize + fixup later if we could simply initialize page tables properly?

Just move everything into kasan_init_64.c
kasan_zero_p* could be a normal C arrays (with __page_aligned_bss attribute).
Initialize these page tables in something like kasan_early_init() before kasan_map_early_shadow()
call.


> Best regards,
> Alexander
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ