Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1175860

[PATCH v2 3/6] x86_64: kasan: flush tlbs after switching cr3

From Andrey Ryabinin <a.ryabinin@samsung.com>
Newsgroups linux.kernel
Subject [PATCH v2 3/6] x86_64: kasan: flush tlbs after switching cr3
Date 2015-07-02 11:20 +0200
Message-ID <pHIP1-Na-33@gated-at.bofh.it> (permalink)
References <pHIP0-Na-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <a.ryabinin@samsung.com>
Cc: <stable@vger.kernel.org> # 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/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/6] x86_64 kasan fixes Andrey Ryabinin <a.ryabinin@samsung.com> - 2015-07-02 11:20 +0200
  [PATCH v2 4/6] x86_64: kasan: fix boot crash on AMD processors Andrey Ryabinin <a.ryabinin@samsung.com> - 2015-07-02 11:20 +0200
  [PATCH v2 2/6] x86_64: kasan: fix kasan shadow region page tables Andrey Ryabinin <a.ryabinin@samsung.com> - 2015-07-02 11:20 +0200
  [PATCH v2 5/6] x86_64: kasan: add message about kasan being initialized Andrey Ryabinin <a.ryabinin@samsung.com> - 2015-07-02 11:20 +0200
  [PATCH v2 3/6] x86_64: kasan: flush tlbs after switching cr3 Andrey Ryabinin <a.ryabinin@samsung.com> - 2015-07-02 11:20 +0200

csiph-web