Commit 4a5a2ac2 authored by Brian Norris's avatar Brian Norris Committed by Treehugger Robot
Browse files

UPSTREAM: PCI/pwrctrl: Cancel outstanding rescan work when unregistering



It's possible to trigger use-after-free here by:

  (a) forcing rescan_work_func() to take a long time and
  (b) utilizing a pwrctrl driver that may be unloaded for some reason

Cancel outstanding work to ensure it is finished before we allow our data
structures to be cleaned up.

[bhelgaas: tidy commit log]
Bug: 415347036
Fixes: 8f62819a ("PCI/pwrctl: Rescan bus on a separate thread")
Change-Id: Ia319526ed4ef06bec3180378c9a008340cec9658
Signed-off-by: default avatarBrian Norris <briannorris@google.com>
Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarKrzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Cc: Konrad Dybcio <konradybcio@kernel.org>
Link: https://patch.msgid.link/20250409115313.1.Ia319526ed4ef06bec3180378c9a008340cec9658@changeid
(cherry picked from commit 8b926f23)
parent 174f671d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment