All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org
Cc: Alexander Potapenko <glider@google.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
	Sean Christopherson <seanjc@google.com>,
	syzbot+8cdd16fd5a6c0565e227@syzkaller.appspotmail.com
Subject: [PATCH 0/3] x86/kasan: Populate shadow for read-only IDT mapping
Date: Fri,  4 Nov 2022 18:32:44 +0000	[thread overview]
Message-ID: <20221104183247.834988-1-seanjc@google.com> (raw)

Fix a regression introduced by mapping shadows for the per-cpu portions of
the CPU entry area on-demand.  The read-only IDT mapping is also shoved
into the CPU entry area, but since it's shared, no CPU creates a shadow
for it.  KVM on Intel does an IDT lookup in software when handling host
IRQs that arrived in the guest, which results in KASAN dereferencing an
unmapped shadow.

The first two patches are cleanups to make the fix (and code in general)
less ugly.

Side topic, KASAN should really decide whether it wants to use "void *"
or "unsigned long", e.g. kasan_populate_shadow() takes "unsigned long" but
kasan_populate_early_shadow() takes "void *".  And the amount of casting
throughout the code is bonkers.

Sean Christopherson (3):
  x86/kasan: Rename local CPU_ENTRY_AREA variables to shorten names
  x86/kasan: Add helpers to align shadow addresses up and down
  x86/kasan: Populate shadow for shared chunk of the CPU entry area

 arch/x86/mm/kasan_init_64.c | 50 ++++++++++++++++++++++++-------------
 1 file changed, 32 insertions(+), 18 deletions(-)


base-commit: 3301badde43dee7c2a013fbd6479c258366519da
-- 
2.38.1.431.g37b22c650d-goog


             reply	other threads:[~2022-11-04 18:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 18:32 Sean Christopherson [this message]
2022-11-04 18:32 ` [PATCH 1/3] x86/kasan: Rename local CPU_ENTRY_AREA variables to shorten names Sean Christopherson
2022-11-04 18:32 ` [PATCH 2/3] x86/kasan: Add helpers to align shadow addresses up and down Sean Christopherson
2022-11-04 18:32 ` [PATCH 3/3] x86/kasan: Populate shadow for shared chunk of the CPU entry area Sean Christopherson
2022-11-08 19:55   ` Andrey Ryabinin
2022-11-08 20:03     ` Sean Christopherson
2022-11-08 20:32       ` Andrey Ryabinin
2022-11-09 18:14     ` Sean Christopherson

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=20221104183247.834988-1-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=andreyknvl@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=hpa@zytor.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ryabinin.a.a@gmail.com \
    --cc=syzbot+8cdd16fd5a6c0565e227@syzkaller.appspotmail.com \
    --cc=tglx@linutronix.de \
    --cc=vincenzo.frascino@arm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.