Skip to content

virtio: Harden and test vring

Andrew Scull u-boot 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest12 patches 1 replyIn review
  2. v212 patches 2 repliesSuperseded
  3. v111 patches 20 repliesSuperseded

Changes in v3 from the cover letter

- Refactor vring init loop per review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12virtio_ring: Merge identical variablesdrivers/virtio/virtio_ring.c+3 -41 reply
2/12virtio_ring: Add helper to attach vring descriptordrivers/virtio/virtio_ring.c+17 -190 replies
3/12virtio_ring: Maintain a shadow copy of descriptorsdrivers/virtio/virtio_ring.c include/virtio_ring.h+43 -160 replies
4/12virtio_ring: Check used descriptors are chain headsdrivers/virtio/virtio_ring.c include/virtio_ring.h+14 -00 replies
5/12dm: test: virtio: Test the virtio ringtest/dm/virtio.c+72 -00 replies
6/12virtio: sandbox: Fix device features bitfielddrivers/virtio/virtio_sandbox.c test/dm/virtio.c+2 -20 replies
7/12test: dm: virtio: Test notify before del_vqstest/dm/virtio.c+1 -10 replies
8/12test: dm: virtio: Split out virtio device teststest/dm/Makefile test/dm/virtio.c test/dm/virtio_device.c+190 -1720 replies
9/12virtio: sandbox: Bind RNG rather than block devicedrivers/virtio/virtio_sandbox.c test/dm/Makefile test/dm/virtio_device.c+4 -40 replies
10/12test: dm: virtio: Test virtio device driver probingtest/dm/virtio_device.c+9 -00 replies
11/12virtio: rng: Check length before copyingdrivers/virtio/virtio_rng.c+3 -00 replies
12/12test: dm: virtio_rng: Test virtio-rng with faked devicetest/dm/Makefile test/dm/virtio_rng.c+53 -00 replies

Reviews trailers per patch

11 of 12 patches have a Reviewed-by or Acked-by.

PatchSimon GlassBin Meng
1/12R-b R-b
2/12R-b
3/12R-b
4/12R-b
5/12R-b
6/12R-b
7/12R-b
8/12
9/12R-b
10/12R-b
11/12R-b
12/12R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/12] virtio: Harden and test vring

Make the virtio ring code resilient against corruption of the buffers shared with the device.

It follows the example of Linux by keeping a private copy of the descriptors and metadata for state tracking and only ever writing to the descriptors that are shared with the device. I was able to test these hardening steps in the sandbox by simulating device writes to the queues.

From v1:
- Fix build errors on SPL by making dependency on virtio drivers explicit
From v2:
- Refactor vring init loop per review

Andrew Scull (12):
virtio_ring: Merge identical variables
virtio_ring: Add helper to attach vring descriptor
virtio_ring: Maintain a shadow copy of descriptors
virtio_ring: Check used descriptors are chain heads
dm: test: virtio: Test the virtio ring
virtio: sandbox: Fix device features bitfield
test: dm: virtio: Test notify before del_vqs
test: dm: virtio: Split out virtio device tests
virtio: sandbox: Bind RNG rather than block device
test: dm: virtio: Test virtio device driver probing
virtio: rng: Check length before copying
test: dm: virtio_rng: Test virtio-rng with faked device

 drivers/virtio/virtio_ring.c    |  96 ++++++++++------
 drivers/virtio/virtio_rng.c     |   3 +
 drivers/virtio/virtio_sandbox.c |   4 +-
 include/virtio_ring.h           |  12 ++
 test/dm/Makefile                |   6 +-
 test/dm/virtio.c                |  99 ----------------
 test/dm/virtio_device.c         | 195 ++++++++++++++++++++++++++++++++
 test/dm/virtio_rng.c            |  52 +++++++++
 8 files changed, 330 insertions(+), 137 deletions(-)
 create mode 100644 test/dm/virtio_device.c
 create mode 100644 test/dm/virtio_rng.c
Signature · 1 line
2.36.0.550.gb090851708-goog