]> Git Repo - linux.git/commit
iavf: Detach device during reset task
authorIvan Vecera <[email protected]>
Tue, 30 Aug 2022 08:16:27 +0000 (10:16 +0200)
committerTony Nguyen <[email protected]>
Fri, 2 Sep 2022 18:17:02 +0000 (11:17 -0700)
commitaa626da947e9cd30c4cf727493903e1adbb2c0a0
tree16ce59e008005c612dd7b636d720f3da8e3129d2
parentfb8396aeda5872369a8ed6d2301e2c86e303c520
iavf: Detach device during reset task

iavf_reset_task() takes crit_lock at the beginning and holds
it during whole call. The function subsequently calls
iavf_init_interrupt_scheme() that grabs RTNL. Problem occurs
when userspace initiates during the reset task any ndo callback
that runs under RTNL like iavf_open() because some of that
functions tries to take crit_lock. This leads to classic A-B B-A
deadlock scenario.

To resolve this situation the device should be detached in
iavf_reset_task() prior taking crit_lock to avoid subsequent
ndos running under RTNL and reattach the device at the end.

Fixes: 62fe2a865e6d ("i40evf: add missing rtnl_lock() around i40evf_set_interrupt_capability")
Cc: Jacob Keller <[email protected]>
Cc: Patryk Piotrowski <[email protected]>
Cc: SlawomirX Laba <[email protected]>
Tested-by: Vitaly Grinberg <[email protected]>
Signed-off-by: Ivan Vecera <[email protected]>
Tested-by: Konrad Jankowski <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
drivers/net/ethernet/intel/iavf/iavf_main.c
This page took 0.057243 seconds and 4 git commands to generate.