aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strcpy.c
diff options
context:
space:
mode:
authorLukas Wunner <[email protected]>2019-08-09 12:28:43 +0200
committerBjorn Helgaas <[email protected]>2019-10-04 15:39:36 -0500
commit157c1062fcd86ade3c674503705033051fd3d401 (patch)
tree78038be473f0c5df2880a57ce078df1f7d4806b5 /lib/test_fortify/write_overflow-strcpy.c
parent54ecb8f7028c5eb3d740bb82b0f1d90f2df63c5c (diff)
PCI: pciehp: Avoid returning prematurely from sysfs requests
A sysfs request to enable or disable a PCIe hotplug slot should not return before it has been carried out. That is sought to be achieved by waiting until the controller's "pending_events" have been cleared. However the IRQ thread pciehp_ist() clears the "pending_events" before it acts on them. If pciehp_sysfs_enable_slot() / _disable_slot() happen to check the "pending_events" after they have been cleared but while pciehp_ist() is still running, the functions may return prematurely with an incorrect return value. Fix by introducing an "ist_running" flag which must be false before a sysfs request is allowed to return. Fixes: 32a8cef274fe ("PCI: pciehp: Enable/disable exclusively from IRQ thread") Link: https://lore.kernel.org/linux-pci/[email protected] Link: https://lore.kernel.org/r/4174210466e27eb7e2243dd1d801d5f75baaffd8.1565345211.git.lukas@wunner.de Reported-and-tested-by: Xiongfeng Wang <[email protected]> Signed-off-by: Lukas Wunner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Cc: [email protected] # v4.19+
Diffstat (limited to 'lib/test_fortify/write_overflow-strcpy.c')
0 files changed, 0 insertions, 0 deletions