[PATCH 00/11] virtio: pci: Add and fix consistency checks

Andrew Scull ascull at google.com
Sun Mar 20 12:41:07 CET 2022


The virtio PCI drivers forgo a number of consistency checks,
particularly around pointer validation and bounds checking. This series
focuses on the modern driver to add those checks.

The start of the series adds and fixes some basic bounds checks. Later
patches ensure PCI addresses fall within the expected regions rather
than any arbitrary address.

The series applies atop v2022.04-rc4. I have been boot testing on the
AOSP cuttlefish virtualized device and protected KVM as part of the
Android Virtualization Framework (AVF).

Andrew Scull (11):
  virtio: pci: Fix discovery of device config length
  virtio: pci: Bounds check device config access
  virtio: pci: Bounds check notification writes
  virtio: pci: Check virtio common config size
  virtio: pci: Check virtio capability is in bounds
  virtio: pci: Read entire capability into memory
  virtio: pci: Check virtio configs are mapped
  pci: Check region ranges are addressable
  pci: Add function to validate PCI address range
  virtio: pci: Check mapped range is in a PCI region
  virtio: pci: Allow exclusion of legacy driver

 drivers/pci/pci-uclass.c           |  47 ++++++++-
 drivers/virtio/Kconfig             |   9 ++
 drivers/virtio/Makefile            |   3 +-
 drivers/virtio/virtio_pci_modern.c | 147 ++++++++++++++++++++++-------
 include/pci.h                      |  16 ++++
 5 files changed, 184 insertions(+), 38 deletions(-)

-- 
2.35.1.894.gb6a874cedc-goog



More information about the U-Boot mailing list