linux/drivers/pci
Gustavo A. R. Silva 4a7ce83349 PCI/P2PDMA: Fix undefined behavior bug in struct pci_p2pdma_pagemap
Struct dev_pagemap is a flexible structure, which means that it contains a
flexible-array member.  If dev_pagemap.nr_range > 1, the memory following
the dev_pagemap could be overwritten.

This is currently not an issue because pci_p2pdma_pagemap is not exposed
outside p2pdma.c, and p2pdma.c only sets dev_pagemap.nr_range to 1.

To prevent problems if p2pdma.c ever uses nr_range > 1, move the flexible
struct dev_pagemap to the end of struct pci_p2pdma_pagemap.

-Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
ready to enable it globally.

Link: https://lore.kernel.org/r/ZRsUL/hATNruwtla@work
Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
2023-10-03 17:13:38 -05:00
..
controller pci-v6.6-changes 2023-08-30 20:23:07 -07:00
endpoint Merge branch 'pci/misc' 2023-08-29 11:03:57 -05:00
hotplug powerpc updates for 6.6 2023-08-31 12:43:10 -07:00
msi PCI: Fix typos in docs and comments 2023-08-25 08:15:38 -05:00
pcie Merge branch 'pci/misc' 2023-08-29 11:03:57 -05:00
switch PCI: switchtec: Add support for PCIe Gen5 devices 2023-08-09 14:16:44 -05:00
access.c PCI: Simplify pcie_capability_clear_and_set_word() control flow 2023-08-25 08:16:10 -05:00
ats.c PCI: Enable PASID only when ACS RR & UF enabled on upstream path 2022-11-03 15:47:47 +01:00
bus.c Devicetree updates for v6.6: 2023-08-30 16:59:03 -07:00
doe.c PCI/DOE: Fix destroy_work_on_stack() race 2023-07-27 15:20:47 -05:00
ecam.c
host-bridge.c
iov.c PCI/IOV: Use pci_dev_id() to simplify the code 2023-08-07 16:15:39 -05:00
irq.c PCI: Check for alloc failure in pci_request_irq() 2022-11-21 16:55:18 -06:00
Kconfig PCI: Fix CONFIG_PCI_DYNAMIC_OF_NODES kconfig dependencies 2023-09-05 12:42:28 -05:00
Makefile PCI: Create device tree node for bridge 2023-08-22 14:56:09 -05:00
mmap.c PCI: Remove pci_mmap_page_range() wrapper 2022-07-29 12:08:44 -05:00
of_property.c PCI: Create device tree node for bridge 2023-08-22 14:56:09 -05:00
of.c Devicetree updates for v6.6: 2023-08-30 16:59:03 -07:00
p2pdma.c PCI/P2PDMA: Fix undefined behavior bug in struct pci_p2pdma_pagemap 2023-10-03 17:13:38 -05:00
pci-acpi.c PCI/ACPI: Call _REG when transitioning D-states 2023-06-23 12:28:08 -05:00
pci-bridge-emul.c PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value 2022-08-25 12:07:56 +02:00
pci-bridge-emul.h PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value 2022-08-25 12:07:56 +02:00
pci-driver.c PCI: Simplify pci_dev_driver() 2023-08-25 08:15:29 -05:00
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c PCI: pci_stub: Set driver_managed_dma 2022-04-28 15:32:20 +02:00
pci-sysfs.c PCI/sysfs: Make I/O resource depend on HAS_IOPORT 2023-07-18 16:56:58 -05:00
pci.c Merge branch 'pci/misc' 2023-08-29 11:03:57 -05:00
pci.h pci-v6.6-changes 2023-08-30 20:23:07 -07:00
probe.c PCI: Free released resource after coalescing 2023-09-06 12:19:29 -05:00
proc.c PCI: Remove pci_mmap_page_range() wrapper 2022-07-29 12:08:44 -05:00
quirks.c Revert "PCI: Mark NVIDIA T4 GPUs to avoid bus reset" 2023-09-08 15:11:45 -05:00
remove.c PCI: Create device tree node for bridge 2023-08-22 14:56:09 -05:00
rom.c
search.c
setup-bus.c PCI: Fix typos in docs and comments 2023-08-25 08:15:38 -05:00
setup-irq.c
setup-res.c PCI: Fix printk field formatting 2023-08-25 08:15:08 -05:00
slot.c PCI/sysfs: Constify struct kobj_type pci_slot_ktype 2023-02-16 12:00:25 -06:00
syscall.c PCI: Use consistent put_user() pointer types 2023-08-25 08:15:13 -05:00
vc.c
vgaarb.c PCI/VGA: Fix typos 2023-08-24 13:27:47 -05:00
vpd.c PCI/VPD: Add runtime power management to sysfs interface 2023-08-11 14:19:16 -05:00
xen-pcifront.c x86: always initialize xen-swiotlb when xen-pcifront is enabling 2023-07-31 17:54:27 +02:00