linux-stable/drivers/pci
Lukas Wunner 81c4b5bf30 PCI: hotplug: Constify hotplug_slot_ops
Hotplug drivers cannot declare their hotplug_slot_ops const, making them
attractive targets for attackers, because upon registration of a hotplug
slot, __pci_hp_initialize() writes to the "owner" and "mod_name" members
in that struct.

Fix by moving these members to struct hotplug_slot and constify every
driver's hotplug_slot_ops except for pciehp.

pciehp constructs its hotplug_slot_ops at runtime based on the PCIe
port's capabilities, hence cannot declare them const.  It can be
converted to __write_rarely once that's mainlined:
http://www.openwall.com/lists/kernel-hardening/2016/11/16/3

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>  # drivers/pci/hotplug/rpa*
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> # drivers/platform/x86
Cc: Len Brown <lenb@kernel.org>
Cc: Scott Murray <scott@spiteful.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Oliver OHalloran <oliveroh@au1.ibm.com>
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>
Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Cc: Corentin Chary <corentin.chary@gmail.com>
Cc: Darren Hart <dvhart@infradead.org>
2018-09-18 17:52:15 -05:00
..
controller pci-v4.19-changes 2018-08-16 09:21:54 -07:00
endpoint Merge branch 'remotes/lorenzo/pci/dwc' 2018-08-15 14:59:11 -05:00
hotplug PCI: hotplug: Constify hotplug_slot_ops 2018-09-18 17:52:15 -05:00
pcie PCI: Simplify disconnected marking 2018-09-17 16:34:35 -05:00
switch switchtec: Fix Spectre v1 vulnerability 2018-09-11 08:47:40 -05:00
access.c Merge branch 'pci/vpd' 2018-04-04 13:28:40 -05:00
ats.c PCI: Enable PASID only if entire path supports End-End TLP prefixes 2018-06-30 14:10:03 -05:00
bus.c PCI: Fix is_added/is_busmaster race condition 2018-07-31 11:27:54 -05:00
ecam.c PCI: Add SPDX GPL-2.0 to replace GPL v2 boilerplate 2018-01-28 15:48:29 -06:00
host-bridge.c PCI: Tidy comments 2018-03-19 14:20:43 -05:00
iov.c Merge branch 'pci/virtualization' 2018-08-15 14:59:06 -05:00
irq.c PCI: Use IRQF_ONESHOT if pci_request_irq() called with no handler 2018-07-31 10:43:43 -05:00
Kconfig PCI: Collect all native drivers under drivers/pci/controller/ 2018-06-08 07:50:11 -05:00
Makefile PCI: Initialize endpoint library before controllers 2018-06-26 15:37:37 -05:00
mmap.c PCI: Tidy comments 2018-03-19 14:20:43 -05:00
msi.c PCI/MSI: Set IRQCHIP_ONESHOT_SAFE for PCI-MSI irqchips 2018-08-14 16:11:02 -05:00
of.c Merge branch 'pci/resource' 2018-08-15 14:59:01 -05:00
pci-acpi.c More power management updates for 4.19-rc1 2018-08-22 07:42:36 -07:00
pci-driver.c Merge branch 'pci/misc' 2018-08-15 14:58:54 -05:00
pci-label.c PCI: Tidy comments 2018-03-19 14:20:43 -05:00
pci-mid.c PCI: Add SPDX GPL-2.0 to replace GPL v2 boilerplate 2018-01-28 15:48:29 -06:00
pci-pf-stub.c PCI/IOV: Add pci-pf-stub driver for PFs that only enable VFs 2018-04-24 16:47:16 -05:00
pci-stub.c PCI: Tidy comments 2018-03-19 14:20:43 -05:00
pci-sysfs.c Merge branch 'pci/hotplug' 2018-08-15 14:58:52 -05:00
pci.c PCI: hotplug: Constify hotplug_slot_ops 2018-09-18 17:52:15 -05:00
pci.h Merge branch 'pci/virtualization' 2018-08-15 14:59:06 -05:00
probe.c PCI: Fix enabling of PASID on RC integrated endpoints 2018-09-11 21:46:49 -05:00
proc.c proc: introduce proc_create_seq{,_data} 2018-05-16 07:23:35 +02:00
quirks.c Revert "PCI: Add ACS quirk for Intel 300 series" 2018-09-11 08:47:38 -05:00
remove.c Merge branch 'pci/aspm' 2018-08-15 14:58:46 -05:00
rom.c PCI: Make pci_get_rom_size() static 2018-06-29 21:17:26 -05:00
search.c PCI: Tidy comments 2018-03-19 14:20:43 -05:00
setup-bus.c PCI: Move resource distribution for single bridge outside loop 2018-06-04 12:08:06 -05:00
setup-irq.c PCI: Tidy comments 2018-03-19 14:20:43 -05:00
setup-res.c PCI: Remove messages about reassigning resources 2018-04-11 08:46:50 -05:00
slot.c PCI: hotplug: Constify hotplug_slot_ops 2018-09-18 17:52:15 -05:00
syscall.c PCI: Tidy comments 2018-03-19 14:20:43 -05:00
vc.c Merge branch 'pci/spdx' into next 2018-02-01 11:40:07 -06:00
vpd.c PCI/VPD: Check for VPD access completion before checking for timeout 2018-08-14 16:04:46 -05:00
xen-pcifront.c PCI: Tidy comments 2018-03-19 14:20:43 -05:00