All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/18] virtio: pci: Add and fix consistency checks
@ 2022-03-29 16:58 Andrew Scull
  2022-03-29 16:58 ` [PATCH v2 01/18] virtio: pci: Allow exclusion of legacy driver Andrew Scull
                   ` (18 more replies)
  0 siblings, 19 replies; 49+ messages in thread
From: Andrew Scull @ 2022-03-29 16:58 UTC (permalink / raw)
  To: u-boot; +Cc: sjg, bmeng.cn, adelva, keirf, ptosi, Andrew Scull

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. This is acheived by introducing range
parameters to a few of the dm_pci_* functions that allow the ranges to
be checked.

The series also adds a few new configs to allow parts of virtio and PCI
to be disabled where the features may be unused and the current
implementations don't have the needed consistencty checks.

Changelog:
v2:
 - Refactor dm_pci_* functions, not adding new ones
 - Reorder patches per request in v1

Andrew Scull (18):
  virtio: pci: Allow exclusion of legacy driver
  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
  pci: Fix use of flags in dm_pci_map_bar()
  pci: Add config for Enhanced Allocation
  pci: Check region ranges are addressable
  pci: Range check address conversions
  test: pci: Test PCI address conversion functions
  pci: Map bars with offset and length
  pci: Match region flags using a mask
  pci: Update dm_pci_bus_to_virt() parameters
  pci: Add mask parameter to dm_pci_map_bar()
  virtio: pci: Check virtio configs are mapped
  virtio: pci: Make use of dm_pci_map_bar()

 arch/sandbox/dts/test.dts               |   2 +-
 arch/x86/cpu/baytrail/cpu.c             |   2 +-
 drivers/ata/ahci.c                      |   9 +-
 drivers/bios_emulator/atibios.c         |   4 +-
 drivers/gpio/octeon_gpio.c              |   2 +-
 drivers/i2c/designware_i2c_pci.c        |   3 +-
 drivers/i2c/intel_i2c.c                 |   2 +-
 drivers/i2c/octeon_i2c.c                |   2 +-
 drivers/mmc/octeontx_hsmmc.c            |   2 +-
 drivers/mmc/pci_mmc.c                   |   2 +-
 drivers/mtd/nand/raw/octeontx_bch.c     |   6 +-
 drivers/mtd/nand/raw/octeontx_nand.c    |   2 +-
 drivers/net/bnxt/bnxt.c                 |   9 +-
 drivers/net/fsl_enetc.c                 |   2 +-
 drivers/net/fsl_enetc_mdio.c            |   2 +-
 drivers/net/mscc_eswitch/felix_switch.c |   4 +-
 drivers/net/octeontx/bgx.c              |   2 +-
 drivers/net/octeontx/nic_main.c         |   2 +-
 drivers/net/octeontx/nicvf_main.c       |   2 +-
 drivers/net/octeontx/smi.c              |   2 +-
 drivers/net/octeontx2/cgx.c             |   2 +-
 drivers/net/octeontx2/rvu_af.c          |   2 +-
 drivers/net/octeontx2/rvu_pf.c          |   3 +-
 drivers/net/pch_gbe.c                   |   2 +-
 drivers/nvme/nvme_pci.c                 |   4 +-
 drivers/pci/Kconfig                     |   7 +
 drivers/pci/pci-uclass.c                | 197 +++++++++++-------------
 drivers/spi/octeon_spi.c                |   2 +-
 drivers/usb/host/ohci-pci.c             |   2 +-
 drivers/virtio/Kconfig                  |   9 ++
 drivers/virtio/Makefile                 |   3 +-
 drivers/virtio/virtio_pci_legacy.c      |   3 +-
 drivers/virtio/virtio_pci_modern.c      | 143 +++++++++++------
 include/pci.h                           |  49 ++++--
 test/dm/pci.c                           | 118 +++++++++++++-
 35 files changed, 399 insertions(+), 210 deletions(-)

-- 
2.35.1.1021.g381101b075-goog


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

end of thread, other threads:[~2023-04-24 14:06 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 16:58 [PATCH v2 00/18] virtio: pci: Add and fix consistency checks Andrew Scull
2022-03-29 16:58 ` [PATCH v2 01/18] virtio: pci: Allow exclusion of legacy driver Andrew Scull
2022-03-29 16:58 ` [PATCH v2 02/18] virtio: pci: Fix discovery of device config length Andrew Scull
2022-03-29 16:58 ` [PATCH v2 03/18] virtio: pci: Bounds check device config access Andrew Scull
2022-03-29 16:58 ` [PATCH v2 04/18] virtio: pci: Bounds check notification writes Andrew Scull
2022-03-29 16:58 ` [PATCH v2 05/18] virtio: pci: Check virtio common config size Andrew Scull
2022-03-29 16:58 ` [PATCH v2 06/18] virtio: pci: Check virtio capability is in bounds Andrew Scull
2022-04-13 13:14   ` Bin Meng
2022-03-29 16:58 ` [PATCH v2 07/18] virtio: pci: Read entire capability into memory Andrew Scull
2022-04-13 13:14   ` Bin Meng
2022-03-29 16:58 ` [PATCH v2 08/18] pci: Fix use of flags in dm_pci_map_bar() Andrew Scull
2022-04-13 13:11   ` Bin Meng
2022-04-13 16:23     ` Andrew Scull
2022-03-29 16:58 ` [PATCH v2 09/18] pci: Add config for Enhanced Allocation Andrew Scull
2022-04-13 13:14   ` Bin Meng
2022-04-13 16:30     ` Andrew Scull
2022-04-14  0:42       ` Bin Meng
2022-04-14  7:58         ` Andrew Scull
2022-04-14  9:39           ` Andrew Scull
2022-04-22  7:44           ` Bin Meng
2022-03-29 16:58 ` [PATCH v2 10/18] pci: Check region ranges are addressable Andrew Scull
2023-04-24 14:06   ` Stefan Agner
2022-03-29 16:58 ` [PATCH v2 11/18] pci: Range check address conversions Andrew Scull
2022-04-13 14:02   ` Bin Meng
2022-03-29 16:58 ` [PATCH v2 12/18] test: pci: Test PCI address conversion functions Andrew Scull
2022-04-13 14:03   ` Bin Meng
2022-04-13 16:44     ` Andrew Scull
2022-03-29 16:58 ` [PATCH v2 13/18] pci: Map bars with offset and length Andrew Scull
2022-04-12 16:42   ` Tom Rini
2022-04-12 22:54     ` Andrew Scull
2022-04-12 23:11       ` Tom Rini
2022-04-13 14:05   ` Bin Meng
2022-04-13 16:48     ` Andrew Scull
2022-03-29 16:58 ` [PATCH v2 14/18] pci: Match region flags using a mask Andrew Scull
2022-04-13 14:59   ` Bin Meng
2022-03-29 16:58 ` [PATCH v2 15/18] pci: Update dm_pci_bus_to_virt() parameters Andrew Scull
2022-04-13 15:03   ` Bin Meng
2022-04-14  7:44     ` Andrew Scull
2022-03-29 16:58 ` [PATCH v2 16/18] pci: Add mask parameter to dm_pci_map_bar() Andrew Scull
2022-04-13 15:10   ` Bin Meng
2022-04-14  7:46     ` Andrew Scull
2022-03-29 16:58 ` [PATCH v2 17/18] virtio: pci: Check virtio configs are mapped Andrew Scull
2022-04-13 15:12   ` Bin Meng
2022-03-29 16:59 ` [PATCH v2 18/18] virtio: pci: Make use of dm_pci_map_bar() Andrew Scull
2022-04-13 15:14   ` Bin Meng
2022-08-25  8:01     ` Felix Yan
2022-08-28 16:49       ` Xiang W
2022-08-28 17:21         ` Felix Yan
2022-04-13 15:17 ` [PATCH v2 00/18] virtio: pci: Add and fix consistency checks Bin Meng

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.