Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753604AbbGAMNj (ORCPT ); Wed, 1 Jul 2015 08:13:39 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:37325 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbbGAMNd (ORCPT ); Wed, 1 Jul 2015 08:13:33 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-d4-5593d96abad3 Message-id: <5593D969.6020408@samsung.com> Date: Wed, 01 Jul 2015 15:13:29 +0300 From: Andrey Ryabinin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-version: 1.0 To: Ingo Molnar Cc: Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , x86@kernel.org, Andrey Konovalov , Andrew Morton , Borislav Petkov , Alexander Popov , Dmitry Vyukov , Alexander Potapenko , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/5] x86_64: fix kasan shadow region page tables References: <1435654466-8714-1-git-send-email-a.ryabinin@samsung.com> <1435654811-8915-1-git-send-email-a.ryabinin@samsung.com> <1435654811-8915-2-git-send-email-a.ryabinin@samsung.com> <20150701090740.GA16645@gmail.com> In-reply-to: <20150701090740.GA16645@gmail.com> Content-type: text/plain; charset=windows-1251 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRmVeSWpSXmKPExsVy+t/xy7pZNyeHGiybqWjxe+9MVos569ew WUzf0cdu8XnDPzaLCQ/b2C3aP+5ltpi2Udzi8q45bBar/51itLh0YAGTxYKNjxgtNm+aymzx Y8NjVgdej++tfSweO2fdZfdYsKnUY9OqTjaPd+fOsXucmPGbxWP7o6ksHu/3XWXz+LxJzuNE yxfWAK4oLpuU1JzMstQifbsEroxdDXPYC3r5Kw4+PMHWwLiFp4uRk0NCwERi/6d2NghbTOLC vfVANheHkMBSRokTbXtZQRJCAt8ZJVYfkgSxeQW0JGYdfsYCYrMIqEocOXyGCcRmE9CT+Ddr O9ggUYEIibeXTzJB1AtK/Jh8D6xeREBJYvGXj+wgC5gFljJLPNuyHKxBWMBFoq1rAzPE5keM Elt2vweq4uDgFNCX2HsiDKSGGWjBp3s32SFseYnNa94yT2AUmIVkxywkZbOQlC1gZF7FKJpa mlxQnJSea6hXnJhbXJqXrpecn7uJERJRX3YwLj5mdYhRgINRiYdXQGxyqBBrYllxZe4hRgkO ZiUR3i9TgUK8KYmVValF+fFFpTmpxYcYpTlYlMR55+56HyIkkJ5YkpqdmlqQWgSTZeLglGpg zFo5VYo1Z9O+ggvfljA+uL2cj4lth8X1FE6VLef7tVesLeB+6i+Z1rm3JPVhLK8Cc8ii07en hogs+sI2oWmiGVOxAu+1koxf9QdzZ2VlGctxt66ZzKAx8bfU5rnTeOtfPPsfeit82cuLn34F yWsv/pfKnPn53WedmRGCinevrXDOXBeooXLyjhJLcUaioRZzUXEiABsJgZekAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2123 Lines: 60 On 07/01/2015 12:07 PM, Ingo Molnar wrote: > > * Andrey Ryabinin wrote: > >> diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c >> index 5a46681..f129a9a 100644 >> --- a/arch/x86/kernel/head64.c >> +++ b/arch/x86/kernel/head64.c >> @@ -161,11 +161,12 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data) >> /* Kill off the identity-map trampoline */ >> reset_early_page_tables(); >> >> - kasan_map_early_shadow(early_level4_pgt); >> - >> - /* clear bss before set_intr_gate with early_idt_handler */ >> clear_bss(); >> >> + clear_page(init_level4_pgt); >> + >> + kasan_early_init(); >> + >> for (i = 0; i < NUM_EXCEPTION_VECTORS; i++) >> set_intr_gate(i, early_idt_handler_array[i]); >> load_idt((const struct desc_ptr *)&idt_descr); >> @@ -177,12 +178,9 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data) >> */ >> load_ucode_bsp(); >> >> - clear_page(init_level4_pgt); >> /* set init_level4_pgt kernel high mapping*/ >> init_level4_pgt[511] = early_level4_pgt[511]; >> >> - kasan_map_early_shadow(init_level4_pgt); >> - >> x86_64_start_reservations(real_mode_data); >> } >> > > So this changes generic code (moves the clear_page(init_level4_pgt) call), but the > changelog claims it's a KASAN-specific change. > > Please split this into two patches: the first one does the generic change, the > second one the KASAN specific one. > Hm... We will need to backport that generic change to stable, because second change depends on it. So, maybe split this on three changes: #1 fix kasan page tables (without touching clear_page() or kasan_map_early_shadow(init_level4_pgt)) #2 generic move clear_page() #3 clean up kasan initialization (move kasan_map_early_shadow(init_level4_pgt)). Only #1 will have stable tag. Does that makes sense? -- 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/