Skip to content

Commit cb28197

Browse files
committed
idpf: protect shutdown from reset
jira LE-3467 Rebuild_History Non-Buildable kernel-4.18.0-553.58.1.el8_10 commit-author Larysa Zaremba <larysa.zaremba@intel.com> commit ed375b1 Before the referenced commit, the shutdown just called idpf_remove(), this way IDPF_REMOVE_IN_PROG was protecting us from the serv_task rescheduling reset. Without this flag set the shutdown process is vulnerable to HW reset or any other triggering conditions (such as default mailbox being destroyed). When one of conditions checked in idpf_service_task becomes true, vc_event_task can be rescheduled during shutdown, this leads to accessing freed memory e.g. idpf_req_rel_vector_indexes() trying to read vport->q_vector_idxs. This in turn causes the system to become defunct during e.g. systemctl kexec. Considering using IDPF_REMOVE_IN_PROG would lead to more heavy shutdown process, instead just cancel the serv_task before cancelling adapter->serv_task before cancelling adapter->vc_event_task to ensure that reset will not be scheduled while we are doing a shutdown. Fixes: 4c9106f ("idpf: fix adapter NULL pointer dereference on reboot") Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Samuel Salin <Samuel.salin@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> (cherry picked from commit ed375b1) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 3ac747e commit cb28197

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/intel/idpf/idpf_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ static void idpf_shutdown(struct pci_dev *pdev)
9393
{
9494
struct idpf_adapter *adapter = pci_get_drvdata(pdev);
9595

96+
cancel_delayed_work_sync(&adapter->serv_task);
9697
cancel_delayed_work_sync(&adapter->vc_event_task);
9798
idpf_vc_core_deinit(adapter);
9899
idpf_deinit_dflt_mbx(adapter);

0 commit comments

Comments
 (0)