mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrey Ryabinin <a.ryabinin@samsung.com>
To: Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org
Cc: Andrey Konovalov <adech.fo@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Borislav Petkov <bp@alien8.de>,
	Alexander Popov <alpopov@ptsecurity.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Alexander Potapenko <glider@google.com>,
	linux-kernel@vger.kernel.org,
	Andrey Ryabinin <a.ryabinin@samsung.com>,
	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	[thread overview]
Message-ID: <1435654811-8915-3-git-send-email-a.ryabinin@samsung.com> (raw)
In-Reply-To: <1435654811-8915-1-git-send-email-a.ryabinin@samsung.com>

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.4


  parent reply	other threads:[~2015-06-30  9:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1435654466-8714-1-git-send-email-a.ryabinin@samsung.com>
2015-06-30  9:00 ` [PATCH RESEND 0/5] x86_64 kasan fixes Andrey Ryabinin
2015-06-30  9:00   ` [PATCH 1/5] x86_64: fix kasan shadow region page tables Andrey Ryabinin
2015-07-01  9:07     ` Ingo Molnar
2015-07-01 12:13       ` Andrey Ryabinin
2015-07-02  7:56         ` Ingo Molnar
2015-06-30  9:00   ` Andrey Ryabinin [this message]
2015-06-30  9:00   ` [PATCH 3/5] x86_64: kasan: fix boot crash on AMD processors Andrey Ryabinin
2015-06-30  9:00   ` [PATCH 4/5] x86_64: kasan: add message about kasan being initialized Andrey Ryabinin
2015-06-30  9:00   ` [PATCH 5/5] x86_64: kasan: move KASAN_SHADOW_OFFSET to the arch Kconfig Andrey Ryabinin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435654811-8915-3-git-send-email-a.ryabinin@samsung.com \
    --to=a.ryabinin@samsung.com \
    --cc=adech.fo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alpopov@ptsecurity.com \
    --cc=bp@alien8.de \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®