Skip to content

Commit 368f1b9

Browse files
committed
idpf: fix idpf_vc_core_init error path
jira LE-2522 Rebuild_History Non-Buildable kernel-5.14.0-503.29.1.el9_5 commit-author Pavan Kumar Linga <[email protected]> commit 9b58031 In an event where the platform running the device control plane is rebooted, reset is detected on the driver. It releases all the resources and waits for the reset to complete. Once the reset is done, it tries to build the resources back. At this time if the device control plane is not yet started, then the driver timeouts on the virtchnl message and retries to establish the mailbox again. In the retry flow, mailbox is deinitialized but the mailbox workqueue is still alive and polling for the mailbox message. This results in accessing the released control queue leading to null-ptr-deref. Fix it by unrolling the work queue cancellation and mailbox deinitialization in the reverse order which they got initialized. Fixes: 4930fbf ("idpf: add core init and interrupt request") Fixes: 34c21fa ("idpf: implement virtchnl transaction manager") Cc: [email protected] # 6.9+ Reviewed-by: Tarun K Singh <[email protected]> Signed-off-by: Pavan Kumar Linga <[email protected]> Tested-by: Krishneil Singh <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> (cherry picked from commit 9b58031) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 8c9d137 commit 368f1b9

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,6 +1803,7 @@ static int idpf_init_hard_reset(struct idpf_adapter *adapter)
18031803
*/
18041804
err = idpf_vc_core_init(adapter);
18051805
if (err) {
1806+
cancel_delayed_work_sync(&adapter->mbx_task);
18061807
idpf_deinit_dflt_mbx(adapter);
18071808
goto unlock_mutex;
18081809
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3022,7 +3022,6 @@ int idpf_vc_core_init(struct idpf_adapter *adapter)
30223022
adapter->state = __IDPF_VER_CHECK;
30233023
if (adapter->vcxn_mngr)
30243024
idpf_vc_xn_shutdown(adapter->vcxn_mngr);
3025-
idpf_deinit_dflt_mbx(adapter);
30263025
set_bit(IDPF_HR_DRV_LOAD, adapter->flags);
30273026
queue_delayed_work(adapter->vc_event_wq, &adapter->vc_event_task,
30283027
msecs_to_jiffies(task_delay));

0 commit comments

Comments
 (0)