linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 00/12] More virtio hardening
@ 2021-10-12  6:52 Jason Wang
  2021-10-12  6:52 ` [PATCH V2 01/12] virtio-blk: validate num_queues during probe Jason Wang
                   ` (11 more replies)
  0 siblings, 12 replies; 43+ messages in thread
From: Jason Wang @ 2021-10-12  6:52 UTC (permalink / raw)
  To: mst, jasowang
  Cc: virtualization, linux-kernel, f.hetzelt, david.kaplan, konrad.wilk

Hi All:

This series treis to do more hardening for virito.

patch 1 validates the num_queues for virio-blk device.
patch 2-4 validates max_nr_ports for virito-console device.
patch 5-7 harden virtio-pci interrupts to make sure no exepcted
interrupt handler is tiggered. If this makes sense we can do similar
things in other transport drivers.
patch 8-9 validate used ring length.
patch 9-11 let the driver to validate the used length instead of the
virtio core

Smoking test on blk/net with packed=on/off and iommu_platform=on/off.

Please review.

Changes since V1:
- fix and document the memory ordering around the intx_soft_enabled
  when enabling and disabling INTX interrupt
- for the driver that can validate the used length, virtio core won't
  even try to allocate auxilary arrays and validate the used length
- tweak the commit log
- fix typos

Jason Wang (12):
  virtio-blk: validate num_queues during probe
  virtio: add doc for validate() method
  virtio-console: switch to use .validate()
  virtio_console: validate max_nr_ports before trying to use it
  virtio_config: introduce a new ready method
  virtio_pci: harden MSI-X interrupts
  virtio-pci: harden INTX interrupts
  virtio_ring: fix typos in vring_desc_extra
  virtio_ring: validate used buffer length
  virtio-net: don't let virtio core to validate used length
  virtio-blk: don't let virtio core to validate used length
  virtio-scsi: don't let virtio core to validate used buffer length

 drivers/block/virtio_blk.c         |  4 +-
 drivers/char/virtio_console.c      | 51 +++++++++++++++++--------
 drivers/net/virtio_net.c           |  1 +
 drivers/scsi/virtio_scsi.c         |  1 +
 drivers/virtio/virtio_pci_common.c | 49 ++++++++++++++++++++----
 drivers/virtio/virtio_pci_common.h |  7 +++-
 drivers/virtio/virtio_pci_legacy.c |  5 ++-
 drivers/virtio/virtio_pci_modern.c |  6 ++-
 drivers/virtio/virtio_ring.c       | 60 +++++++++++++++++++++++++++++-
 include/linux/virtio.h             |  3 ++
 include/linux/virtio_config.h      |  6 +++
 11 files changed, 162 insertions(+), 31 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2021-10-20  6:56 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12  6:52 [PATCH V2 00/12] More virtio hardening Jason Wang
2021-10-12  6:52 ` [PATCH V2 01/12] virtio-blk: validate num_queues during probe Jason Wang
2021-10-13 10:04   ` Michael S. Tsirkin
2021-10-14  2:32     ` Jason Wang
2021-10-14  5:45       ` Michael S. Tsirkin
2021-10-14  6:23         ` Jason Wang
2021-10-12  6:52 ` [PATCH V2 02/12] virtio: add doc for validate() method Jason Wang
2021-10-13 10:09   ` Michael S. Tsirkin
2021-10-14  2:32     ` Jason Wang
2021-10-12  6:52 ` [PATCH V2 03/12] virtio-console: switch to use .validate() Jason Wang
2021-10-13  9:50   ` Michael S. Tsirkin
2021-10-14  2:28     ` Jason Wang
2021-10-14  5:58       ` Michael S. Tsirkin
2021-10-12  6:52 ` [PATCH V2 04/12] virtio_console: validate max_nr_ports before trying to use it Jason Wang
2021-10-12  6:52 ` [PATCH V2 05/12] virtio_config: introduce a new ready method Jason Wang
2021-10-13  9:57   ` Michael S. Tsirkin
2021-10-12  6:52 ` [PATCH V2 06/12] virtio_pci: harden MSI-X interrupts Jason Wang
2021-10-13  9:59   ` Michael S. Tsirkin
2021-10-14  2:29     ` Jason Wang
2021-10-15 12:09   ` Dongli Zhang
2021-10-15 17:27     ` Michael S. Tsirkin
2021-10-19  1:33       ` Jason Wang
2021-10-19 17:01         ` Dongli Zhang
2021-10-20  1:33           ` Jason Wang
2021-10-20  6:56             ` Michael S. Tsirkin
2021-10-12  6:52 ` [PATCH V2 07/12] virtio-pci: harden INTX interrupts Jason Wang
2021-10-13  9:42   ` Michael S. Tsirkin
2021-10-14  2:35     ` Jason Wang
2021-10-14  5:49       ` Michael S. Tsirkin
2021-10-14  6:20         ` Jason Wang
2021-10-14  6:26           ` Michael S. Tsirkin
2021-10-14  6:32             ` Jason Wang
2021-10-14  7:04               ` Michael S. Tsirkin
2021-10-14  7:12                 ` Jason Wang
2021-10-14  9:25                   ` Michael S. Tsirkin
2021-10-14 10:03                     ` Jason Wang
2021-10-12  6:52 ` [PATCH V2 08/12] virtio_ring: fix typos in vring_desc_extra Jason Wang
2021-10-12  6:52 ` [PATCH V2 09/12] virtio_ring: validate used buffer length Jason Wang
2021-10-13 10:02   ` Michael S. Tsirkin
2021-10-14  2:30     ` Jason Wang
2021-10-12  6:52 ` [PATCH V2 10/12] virtio-net: don't let virtio core to validate used length Jason Wang
2021-10-12  6:52 ` [PATCH V2 11/12] virtio-blk: " Jason Wang
2021-10-12  6:52 ` [PATCH V2 12/12] virtio-scsi: don't let virtio core to validate used buffer length Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).