Thread (4 messages) 4 messages, 4 authors, 2023-08-31

Re: [PATCH] powerpc/iommu: Fix notifiers being shared by PCI and VIO buses

From: Michael Ellerman <hidden>
Date: 2023-08-31 04:10:35

On Wed, 22 Mar 2023 14:53:22 +1100, Russell Currey wrote:
fail_iommu_setup() registers the fail_iommu_bus_notifier struct to both
PCI and VIO buses.  struct notifier_block is a linked list node, so this
causes any notifiers later registered to either bus type to also be
registered to the other since they share the same node.

This causes issues in (at least) the vgaarb code, which registers a
notifier for PCI buses.  pci_notify() ends up being called on a vio
device, converted with to_pci_dev() even though it's not a PCI device,
and finally makes a bad access in vga_arbiter_add_pci_device() as
discovered with KASAN:

[...]
Applied to powerpc/next.

[1/1] powerpc/iommu: Fix notifiers being shared by PCI and VIO buses
      https://git.kernel.org/powerpc/c/c37b6908f7b2bd24dcaaf14a180e28c9132b9c58

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help