Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751287AbbEYNmV (ORCPT ); Mon, 25 May 2015 09:42:21 -0400 Received: from mx5.ptsecurity.com ([45.58.112.35]:33439 "EHLO mx5.ptsecurity.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934AbbEYNmT (ORCPT ); Mon, 25 May 2015 09:42:19 -0400 Message-ID: <556326EA.10807@ptsecurity.com> Date: Mon, 25 May 2015 16:43:06 +0300 From: Alexander Popov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Andrey Ryabinin CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrey Konovalov , "Denys Vlasenko" , Andy Lutomirski , Alexander Kuleshov , Sergey Kovalev , , Subject: Re: [PATCH 1/1] x86_64: fix KASan shadow region page tables References: <1432310581-11965-1-git-send-email-alpopov@ptsecurity.com> <5562D989.3030206@samsung.com> In-Reply-To: <5562D989.3030206@samsung.com> Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DC1-CAS-02.ptsecurity.ru (10.0.52.115) To dc1-mbx-01.ptsecurity.ru (10.0.52.116) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1155 Lines: 32 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? Best regards, Alexander -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/