diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-05-24 10:15:32 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-05-26 10:10:43 +0200 |
commit | 0b2c2a71e6f07fb67e6f72817d39910f64d2e258 (patch) | |
tree | e80cee308ca16f262db0bec9aba200eb11dde9f4 /drivers/acpi/processor_driver.c | |
parent | 1ddd45f8d76f0c15ec4e44073eeaaee6a806ee81 (diff) | |
download | op-kernel-dev-0b2c2a71e6f07fb67e6f72817d39910f64d2e258.zip op-kernel-dev-0b2c2a71e6f07fb67e6f72817d39910f64d2e258.tar.gz |
PCI: Replace the racy recursion prevention
pci_call_probe() can called recursively when a physcial function is probed
and the probing creates virtual functions, which are populated via
pci_bus_add_device() which in turn can end up calling pci_call_probe()
again.
The code has an interesting way to prevent recursing into the workqueue
code. That's accomplished by a check whether the current task runs already
on the numa node which is associated with the device.
While that works to prevent the recursion into the workqueue code, it's
racy versus normal execution as there is no guarantee that the node does
not vanish after the check.
There is another issue with this code. It dereferences cpumask_of_node()
unconditionally without checking whether the node is available.
Make the detection reliable by:
- Mark a probed device as 'is_probed' in pci_call_probe()
- Check in pci_call_probe for a virtual function. If it's a virtual
function and the associated physical function device is marked
'is_probed' then this is a recursive call, so the call can be invoked in
the calling context.
- Add a check whether the node is online before dereferencing it.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-pci@vger.kernel.org
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20170524081548.771457199@linutronix.de
Diffstat (limited to 'drivers/acpi/processor_driver.c')
0 files changed, 0 insertions, 0 deletions