Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754608AbbGFPh6 (ORCPT ); Mon, 6 Jul 2015 11:37:58 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49102 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752262AbbGFPhy (ORCPT ); Mon, 6 Jul 2015 11:37:54 -0400 Date: Mon, 6 Jul 2015 08:37:04 -0700 From: tip-bot for Andrey Ryabinin Message-ID: Cc: adech.fo@gmail.com, hpa@zytor.com, dvyukov@google.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de, glider@google.com, a.ryabinin@samsung.com, bp@alien8.de, mingo@kernel.org, alpopov@ptsecurity.com Reply-To: peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com, dvyukov@google.com, adech.fo@gmail.com, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, alpopov@ptsecurity.com, bp@alien8.de, mingo@kernel.org, a.ryabinin@samsung.com, glider@google.com In-Reply-To: <1435828178-10975-4-git-send-email-a.ryabinin@samsung.com> References: <1435828178-10975-4-git-send-email-a.ryabinin@samsung.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/kasan: Flush TLBs after switching CR3 Git-Commit-ID: 241d2c54c62fa0939fc9a9512b48ac3434e90a89 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2021 Lines: 57 Commit-ID: 241d2c54c62fa0939fc9a9512b48ac3434e90a89 Gitweb: http://git.kernel.org/tip/241d2c54c62fa0939fc9a9512b48ac3434e90a89 Author: Andrey Ryabinin AuthorDate: Thu, 2 Jul 2015 12:09:35 +0300 Committer: Ingo Molnar CommitDate: Mon, 6 Jul 2015 14:53:14 +0200 x86/kasan: Flush TLBs after switching CR3 load_cr3() doesn't cause tlb_flush if PGE enabled. This may cause tons of false positive reports spamming the kernel to death. To fix this __flush_tlb_all() should be called explicitly after CR3 changed. Signed-off-by: Andrey Ryabinin Cc: # 4.0+ Cc: Alexander Popov Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Borislav Petkov Cc: Dmitry Vyukov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1435828178-10975-4-git-send-email-a.ryabinin@samsung.com Signed-off-by: Ingo Molnar --- 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; } -- 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/