All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] x86/kasan: Populate shadow for read-only IDT mapping
@ 2022-11-04 18:32 Sean Christopherson
  2022-11-04 18:32 ` [PATCH 1/3] x86/kasan: Rename local CPU_ENTRY_AREA variables to shorten names Sean Christopherson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sean Christopherson @ 2022-11-04 18:32 UTC (permalink / raw)
  To: Andrey Ryabinin, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: Alexander Potapenko, Andrey Konovalov, Dmitry Vyukov,
	Vincenzo Frascino, H. Peter Anvin, kasan-dev, linux-kernel,
	Sean Christopherson, syzbot+8cdd16fd5a6c0565e227

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-09 18:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04 18:32 [PATCH 0/3] x86/kasan: Populate shadow for read-only IDT mapping Sean Christopherson
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

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.