public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: x86: selftests: add L1TF exploit test
@ 2025-10-13 15:13 Brendan Jackman
  2025-10-13 15:13 ` [PATCH 1/2] selftests: fix installing nested TEST_GEN_MODS_DIR Brendan Jackman
  2025-10-13 15:13 ` [PATCH 2/2] KVM: x86: selftests: add an L1TF exploit test Brendan Jackman
  0 siblings, 2 replies; 4+ messages in thread
From: Brendan Jackman @ 2025-10-13 15:13 UTC (permalink / raw)
  To: Shuah Khan, Paolo Bonzini, Sean Christopherson
  Cc: Alexandra Sandulescu, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, linux-kselftest, linux-kernel,
	kvm, Brendan Jackman

This has been tested on a Google Skylake platform. 

One potential issue with this test is that it fails (that is, the
exploit succeeds) when using the conditional L1D flush, because the
gadget is injected into the hypercall path which doesn't appear to
include a flush. If this is unacceptable, we should discuss how to amend
the test so that it can be used to evaluate the conditional flush logic
as well. This would basically mean simulating some more complicated
gadget where the "attacker" has found another way to steer the host
kernel towards the target data, instead of just a simple hypercall.

The reason this limitation is tolerable to me is my ulterior motive,
i.e. because I am specifically interested in an end-to-end test for
Address Space Isolation [0], which is abstracted from these details of the
exploit.

Based on kvm/next.

[0] https://lore.kernel.org/all/20250924-b4-asi-page-alloc-v1-0-2d861768041f@google.com/T/#t

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
Alexandra Sandulescu (1):
      KVM: x86: selftests: add an L1TF exploit test

Brendan Jackman (1):
      selftests: fix installing nested TEST_GEN_MODS_DIR

 tools/testing/selftests/kvm/Makefile.kvm           |   7 +
 tools/testing/selftests/kvm/x86/l1tf_test.c        | 633 +++++++++++++++++++++
 tools/testing/selftests/kvm/x86/l1tf_test.sh       |  10 +
 .../selftests/kvm/x86/test_modules/Makefile        |  10 +
 .../kvm/x86/test_modules/l1tf_test_helper.c        |  92 +++
 tools/testing/selftests/lib.mk                     |   2 +-
 6 files changed, 753 insertions(+), 1 deletion(-)
---
base-commit: 6b36119b94d0b2bb8cea9d512017efafd461d6ac
change-id: 20251013-l1tf-test-1bee540cefb4

Best regards,
-- 
Brendan Jackman <jackmanb@google.com>


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

end of thread, other threads:[~2025-10-13 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13 15:13 [PATCH 0/2] KVM: x86: selftests: add L1TF exploit test Brendan Jackman
2025-10-13 15:13 ` [PATCH 1/2] selftests: fix installing nested TEST_GEN_MODS_DIR Brendan Jackman
2025-10-13 15:13 ` [PATCH 2/2] KVM: x86: selftests: add an L1TF exploit test Brendan Jackman
2025-10-13 15:36   ` Brendan Jackman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox