Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840AbbF3JAl (ORCPT ); Tue, 30 Jun 2015 05:00:41 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:38586 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750821AbbF3JAU (ORCPT ); Tue, 30 Jun 2015 05:00:20 -0400 X-AuditID: cbfec7f5-f794b6d000001495-a0-55925aa2003a From: Andrey Ryabinin To: Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , x86@kernel.org Cc: Andrey Konovalov , Andrew Morton , Borislav Petkov , Alexander Popov , Dmitry Vyukov , Alexander Potapenko , linux-kernel@vger.kernel.org, Andrey Ryabinin , stable@vger.kernel.org Subject: [PATCH 2/5] x86_64: kasan: flush tlbs after switching cr3 Date: Tue, 30 Jun 2015 12:00:08 +0300 Message-id: <1435654811-8915-3-git-send-email-a.ryabinin@samsung.com> X-Mailer: git-send-email 2.4.4 In-reply-to: <1435654811-8915-1-git-send-email-a.ryabinin@samsung.com> References: <1435654466-8714-1-git-send-email-a.ryabinin@samsung.com> <1435654811-8915-1-git-send-email-a.ryabinin@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xy7qLoiaFGpz5rmax7dcjNovfe2ey WsxZv4bNYvqOPnaLzxv+sVlMeNjGbtH+cS+zxbSN4haXd81hs7h0YAGTxYKNjxgtNm+aymzx Y8NjVgdej++tfSweO2fdZfdYsKnUY9OqTjaPd+fOsXucmPGbxWP7o6ksHu/3XWXz6NuyitHj 8yY5jxMtX1gDuKO4bFJSczLLUov07RK4MvY9+MBacJ29YsG81ewNjHvZuhg5OCQETCTeT7Hu YuQEMsUkLtxbDxTm4hASWMoocbpnBiOE08Qk0Tr3GDNIFZuAnsS/WdvZQGwRgRqJjtZuZpAi ZoHLTBKPp/azgySEBZwkNjT1sYLYLAKqElP+7gezeQVcJc6cecgGsU5O4sr16WA2p4CbxPJX x1ggtjUySvy6fYd9AiPvAkaGVYyiqaXJBcVJ6blGesWJucWleel6yfm5mxghwfx1B+PSY1aH GAU4GJV4eBOeTgwVYk0sK67MPcQowcGsJMJbJzkpVIg3JbGyKrUoP76oNCe1+BCjNAeLkjjv zF3vQ4QE0hNLUrNTUwtSi2CyTBycUg2MahWJFkp+N26kqyQIe25hzfavnjVdSuL4snkrJfsj LbMZZNwmLdP/WfJidXHlldpjGRb8CcuWbItPeuGow1t6R/zRp70rveRN7uwz+7v3lUfAbLVZ uvFHY7KerVxwftqm5AVzWLLSMyoefSycGzHv0PsrMnwL7r1bUbrD9/7+qthtYdZi4hEXlFiK MxINtZiLihMBMlrrkGICAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1194 Lines: 39 load_cr3() doesn't cause tlb_flush if PGE enabled. This may cause tons of false positive reports spamming kernel to death. To fix this __flush_tlb_all() should be called explicitly after cr3 changed. Signed-off-by: Andrey Ryabinin Cc: # 4.0 --- arch/x86/mm/kasan_init_64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/mm/kasan_init_64.c b/arch/x86/mm/kasan_init_64.c index 0e4a05f..5d26642 100644 --- a/arch/x86/mm/kasan_init_64.c +++ b/arch/x86/mm/kasan_init_64.c @@ -208,6 +208,7 @@ void __init kasan_init(void) memcpy(early_level4_pgt, init_level4_pgt, sizeof(early_level4_pgt)); load_cr3(early_level4_pgt); + __flush_tlb_all(); clear_pgds(KASAN_SHADOW_START, KASAN_SHADOW_END); @@ -234,5 +235,6 @@ void __init kasan_init(void) memset(kasan_zero_page, 0, PAGE_SIZE); load_cr3(init_level4_pgt); + __flush_tlb_all(); init_task.kasan_depth = 0; } -- 2.4.4 -- 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/