Skip to content

vfio: Fix racy bitfields and tighten struct layout

Alex Williamson kvm lkml stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 5 repliesIn review
  2. v12 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2vfio/pci: Fix racy bitfields and tighten struct layoutinclude/linux/vfio_pci_core.h+4 -45 replies
2/2vfio/mlx5: Fix racy bitfields and tighten struct layoutdrivers/vfio/pci/mlx5/cmd.h+4 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] vfio: Fix racy bitfields and tighten struct layout

A recent patch[1] proposed by Raghavendra triggered a Sashiko review[2] flagging that the proposed new bitfield shares storage with neighbors and that concurrent updates via RMW may clobber adjacent fields.

Auditing bitfield users in vfio_pci_core_device finds several pre-existing fields with the same hazard, and an analogous pattern in mlx5_vhca_page_tracker / mlx5vf_pci_core_device. This series splits all such fields out of their shared storage words, resolving the existing cases.

v2: Uncouple from Raghavendra's patch so that Sashiko can apply
and review (new field dropped), we can handle merge on commit.

Thanks,
Alex

[1] https://lore.kernel.org/all/[email protected]/
[2] https://sashiko.dev/#/patchset/[email protected]

Alex Williamson (2):
vfio/pci: Fix racy bitfields and tighten struct layout vfio/mlx5: Fix racy bitfields and tighten struct layout

 drivers/vfio/pci/mlx5/cmd.h   | 8 ++++----
 include/linux/vfio_pci_core.h | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
2.51.0