[PATCH 0/2] RISC-V: KVM: Validate AIA MMIO ranges against GPA width

Pengpeng Hou <[email protected]>
Newsgroups org.infradead.lists.kvm-riscv,org.infradead.lists.linux-riscv,org.kernel.vger.kvm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
The AIA device API currently checks only the alignment of userspace-
supplied APLIC and IMSIC base addresses.  This can publish a wrapping
fixed-size MMIO interval or one that lies beyond the selected stage-2
guest physical address (GPA) width.

There are two points to close because the GPA width is configurable:

1. Validate every complete range when it is stored and again immediately
   before AIA initialization publishes the first MMIO device.
2. Once AIA initialization has published those devices, prevent the GPA
   width from being reduced below their addresses.

Both initialization and GPA-width changes are serialized by kvm->lock.
The series was reviewed against the RISC-V KVM queue at
dfdf1374fdeccb5b7e3d35186228e01ec5ea5f01.  No build or runtime testing
was performed.

Pengpeng Hou (2):
  RISC-V: KVM: Validate AIA MMIO address ranges
  RISC-V: KVM: Disallow GPA-width changes after AIA init

 arch/riscv/kvm/aia_device.c | 79 +++++++++++++++++++++++++++++++------
 arch/riscv/kvm/vm.c         |  3 +-
 2 files changed, 68 insertions(+), 14 deletions(-)

-- 
2.50.1 (Apple Git-155)


-- 
kvm-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kvm-riscv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.