[kvm-unit-tests PATCH 0/2] Test for CR0.WP=0/1 r/o write access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This mini-series adds an explicit test that verifies a page fault will
occur for attempts to write to an r/o page while CR0.WP=1.

There are existing tests already, e.g. in pks.c, pku.c, smap.c or even
access.c that implicitly test it as well. However, they all either
explicitly (via INVLPG) or implicitly (via CR3 reload) flush the TLB
before such an access which might lead to false positives if the access
succeeded before, e.g. because CR0.WP was 0 before.

Better to have an explicit test, especially to back up the changes of
[1].

Please apply!

Thanks,
Mathias

[1] https://lore.kernel.org/kvm/20230322013731.102955-1-minipli@xxxxxxxxxxxxxx/

Mathias Krause (2):
  x86: Use existing CR0.WP / CR4.SMEP bit definitions
  x86/access: CR0.WP toggling write access test

 x86/access.c | 57 +++++++++++++++++++++++++++++++++++++++++++---------
 x86/pks.c    |  5 ++---
 x86/pku.c    |  5 ++---
 3 files changed, 52 insertions(+), 15 deletions(-)

-- 
2.39.2




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux