From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753219AbbE1I4R (ORCPT ); Thu, 28 May 2015 04:56:17 -0400 Received: from mx5.ptsecurity.com ([45.58.112.35]:13352 "EHLO mx5.ptsecurity.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751515AbbE1I4M (ORCPT ); Thu, 28 May 2015 04:56:12 -0400 Message-ID: <5566D850.8090605@ptsecurity.com> Date: Thu, 28 May 2015 11:56:48 +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> <556326EA.10807@ptsecurity.com> <5564344A.9060005@samsung.com> In-Reply-To: <5564344A.9060005@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-02.ptsecurity.ru (10.0.52.117) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.05.2015 11:52, Andrey Ryabinin wrote: > On 05/25/2015 04:43 PM, Alexander Popov wrote: >> 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. Thanks, I'll do that and return with the second version. Best regards, Alexander