android_kernel_motorola_sm6375/drivers/pci
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sean Anderson 893e831406 PCI: xilinx-nwl: Fix off-by-one in INTx IRQ handler
[ Upstream commit 0199d2f2bd8cd97b310f7ed82a067247d7456029 ]

MSGF_LEG_MASK is laid out with INTA in bit 0, INTB in bit 1, INTC in bit 2,
and INTD in bit 3. Hardware IRQ numbers start at 0, and we register
PCI_NUM_INTX IRQs. So to enable INTA (aka hwirq 0) we should set bit 0.
Remove the subtraction of one.

This bug would cause INTx interrupts not to be delivered, as enabling INTB
would actually enable INTA, and enabling INTA wouldn't enable anything at
all. It is likely that this got overlooked for so long since most PCIe
hardware uses MSIs. This fixes the following UBSAN error:

  UBSAN: shift-out-of-bounds in ../drivers/pci/controller/pcie-xilinx-nwl.c:389:11
  shift exponent 18446744073709551615 is too large for 32-bit type 'int'
  CPU: 1 PID: 61 Comm: kworker/u10:1 Not tainted 6.6.20+ #268
  Hardware name: xlnx,zynqmp (DT)
  Workqueue: events_unbound deferred_probe_work_func
  Call trace:
  dump_backtrace (arch/arm64/kernel/stacktrace.c:235)
  show_stack (arch/arm64/kernel/stacktrace.c:242)
  dump_stack_lvl (lib/dump_stack.c:107)
  dump_stack (lib/dump_stack.c:114)
  __ubsan_handle_shift_out_of_bounds (lib/ubsan.c:218 lib/ubsan.c:387)
  nwl_unmask_leg_irq (drivers/pci/controller/pcie-xilinx-nwl.c:389 (discriminator 1))
  irq_enable (kernel/irq/internals.h:234 kernel/irq/chip.c:170 kernel/irq/chip.c:439 kernel/irq/chip.c:432 kernel/irq/chip.c:345)
  __irq_startup (kernel/irq/internals.h:239 kernel/irq/chip.c:180 kernel/irq/chip.c:250)
  irq_startup (kernel/irq/chip.c:270)
  __setup_irq (kernel/irq/manage.c:1800)
  request_threaded_irq (kernel/irq/manage.c:2206)
  pcie_pme_probe (include/linux/interrupt.h:168 drivers/pci/pcie/pme.c:348)

Fixes: 9a181e1093 ("PCI: xilinx-nwl: Modify IRQ chip for legacy interrupts")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Anderson <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Cc: [email protected]
Signed-off-by: Sasha Levin <[email protected]>
2024-11-08 16:20:34 +01:00
..
controller PCI: xilinx-nwl: Fix off-by-one in INTx IRQ handler 2024-11-08 16:20:34 +01:00
endpoint
hotplug pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv 2024-09-12 11:03:54 +02:00
pcie PCI/DPC: Print all TLP Prefixes, not just the first 2024-03-26 18:22:19 -04:00
switch PCI: switchtec: Fix an error handling path in switchtec_pci_probe() 2024-03-26 18:22:20 -04:00
access.c
ats.c
bus.c
ecam.c
host-bridge.c
iov.c
irq.c
Kconfig
Makefile
mmap.c
msi.c PCI/MSI: Prevent MSI hardware interrupt number truncation 2024-03-01 13:13:36 +01:00
of.c
p2pdma.c
pci-acpi.c PCI/sysfs: Protect driver's D3cold preference from user space 2023-11-28 16:50:18 +00:00
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c PCI/PM: Drain runtime-idle callbacks before driver removal 2024-04-13 12:51:25 +02:00
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c PCI/sysfs: Protect driver's D3cold preference from user space 2023-11-28 16:50:18 +00:00
pci.c PCI: Add missing bridge lock to pci_bus_lock() 2024-09-12 11:03:54 +02:00
pci.h PCI: Unify delay handling for reset and resume 2023-03-22 13:28:09 +01:00
probe.c
proc.c
quirks.c PCI: Mark 3ware-9650SE Root Port Extended Tags as broken 2024-03-26 18:22:21 -04:00
remove.c
rom.c
search.c
setup-bus.c PCI: Fix resource double counting on remove & rescan 2024-08-19 05:33:32 +02:00
setup-irq.c
setup-res.c
slot.c
syscall.c
vc.c
vpd.c
xen-pcifront.c