aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lxdialog/ssh:/git:
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-01 15:58:10 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-07 18:42:44 +0200
commit3fb937f441c64af1eec60bfd3732f64001fcc534 (patch)
treecf4bcd87010d4ef093f8aeb07ffd527b5a89bc5b /scripts/lxdialog/ssh:/git:
parentLinux 5.15-rc4 (diff)
PCI: ACPI: Check parent pointer in acpi_pci_find_companion()
If acpi_pci_find_companion() is called for a device whose parent pointer is NULL, it will crash when attempting to get the ACPI companion of the parent due to a NULL pointer dereference in the ACPI_COMPANION() macro. This was not a problem before commit 375553a93201 ("PCI: Setup ACPI fwnode early and at the same time with OF") that made pci_setup_device() call pci_set_acpi_fwnode() and so it allowed devices with NULL parent pointers to be passed to acpi_pci_find_companion() which is the case in pci_iov_add_virtfn(), for instance. Fix this issue by making acpi_pci_find_companion() check the device's parent pointer upfront and bail out if it is NULL. While pci_iov_add_virtfn() can be changed to set the device's parent pointer before calling pci_setup_device() for it, checking pointers against NULL before dereferencing them is prudent anyway and looking for ACPI companions of virtual functions isn't really useful. Fixes: 375553a93201 ("PCI: Setup ACPI fwnode early and at the same time with OF") Link: https://lore.kernel.org/linux-acpi/8e4bbd5c59de31db71f718556654c0aa077df03d.camel@linux.ibm.com/ Reported-by: Niklas Schnelle <schnelle@linux.ibm.com> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'scripts/lxdialog/ssh:/git:')
0 files changed, 0 insertions, 0 deletions
/seccdn.libravatar.org/avatar/58043e86f52c97091c77fe78a9d8928f?s=13&d=retro' />Steven Rostedt (VMware)1-8/+2 2019-04-05syscalls: Remove start and number from syscall_get_arguments() argsSteven Rostedt (Red Hat)1-8/+3 2019-03-20syscall_get_arch: add "struct task_struct *" argumentDmitry V. Levin1-2/+3 2014-09-23syscall.h: fix doc text for syscall_get_arch()Richard Guy Briggs1-1/+1 2014-03-20syscall_get_arch: remove useless function argumentsEric Paris1-3/+1 2012-04-14asm/syscall.h: add syscall_get_archWill Drewry1-0/+14 2009-09-22asm-generic: syscall_get_nr returns intRoland McGrath1-2/+6 2008-09-05tracehook: comment pasto fixesRoland McGrath1-1/+1 2008-07-26tracehook: asm/syscall.hRoland McGrath1-0/+141