Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753710AbbGBJKw (ORCPT ); Thu, 2 Jul 2015 05:10:52 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:14792 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751382AbbGBJJu (ORCPT ); Thu, 2 Jul 2015 05:09:50 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-e8-5594ffdc795c 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 v2 3/6] x86_64: kasan: flush tlbs after switching cr3 Date: Thu, 02 Jul 2015 12:09:35 +0300 Message-id: <1435828178-10975-4-git-send-email-a.ryabinin@samsung.com> X-Mailer: git-send-email 2.4.5 In-reply-to: <1435828178-10975-1-git-send-email-a.ryabinin@samsung.com> References: <1435828178-10975-1-git-send-email-a.ryabinin@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHLMWRmVeSWpSXmKPExsVy+t/xa7p3/k8JNWjdomOx7dcjNovfe2ey WsxZv4bNYvqOPnaLzxv+sVlMeNjGbtH+cS+zxbSN4haXd81hs7h0YAGTxYKNjxgtNm+aymzx Y8NjVgdej++tfSweO2fdZfdYsKnUY9OqTjaPd+fOsXucmPGbxWP7o6ksHu/3XWXz6NuyitHj 8yY5jxMtX1gDuKO4bFJSczLLUov07RK4MhZ0rGcruMFeMffCdvYGxn1sXYycHBICJhKXN89h hLDFJC7cWw8U5+IQEljKKHFo5l1GCKeJSeLe/xfMIFVsAnoS/2ZtB+sWEaiR6GjtZgYpYha4 zCTxeGo/O0hCWMBV4v/6d2BjWQRUJZ7NPwnWzCvgJrHn6VWgZg6gdXISS5trQcKcAu4SnU1v wFqFgEquNd9lmsDIu4CRYRWjaGppckFxUnquoV5xYm5xaV66XnJ+7iZGSCh/2cG4+JjVIUYB DkYlHt4VNVNChVgTy4orcw8xSnAwK4nwrn8JFOJNSaysSi3Kjy8qzUktPsQozcGiJM47d9f7 ECGB9MSS1OzU1ILUIpgsEwenVANjmK5hpi7Xt1hrLxf9hbq3Pb+lf3vndrUwZtOytqgC5faZ i75muBdvVorTzpZ9bqA1kdPyDf+SDZmNjKt+XP08rzrdq9ag/pPVpA0SlQ2zNh7t4tyz99Dj ZSyfou6X5RhZHD50N/fqJO+AEyekZ0fIHL4uucOtM3btLl7zYxWXFv+f133OU8JCiaU4I9FQ i7moOBEATUYUlWECAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1195 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.5 -- 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/