diff options
author | Ahmed Zaki <ahmed.zaki@intel.com> | 2023-06-05 17:52:26 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-07-27 09:50:43 +0300 |
commit | 3fc081edddf388a2ebcbe843c0ae2385f27f9d5c (patch) | |
tree | 34cf50556835f88cda08ebc6b91c957f252d4913 /security | |
parent | 2647ff59c52ef42c853c905817ed1a7f092d59a5 (diff) | |
download | linux-3fc081edddf388a2ebcbe843c0ae2385f27f9d5c.tar.xz |
iavf: fix reset task race with iavf_remove()
[ Upstream commit c34743daca0eb1dc855831a5210f0800a850088e ]
The reset task is currently scheduled from the watchdog or adminq tasks.
First, all direct calls to schedule the reset task are replaced with the
iavf_schedule_reset(), which is modified to accept the flag showing the
type of reset.
To prevent the reset task from starting once iavf_remove() starts, we need
to check the __IAVF_IN_REMOVE_TASK bit before we schedule it. This is now
easily added to iavf_schedule_reset().
Finally, remove the check for IAVF_FLAG_RESET_NEEDED in the watchdog task.
It is redundant since all callers who set the flag immediately schedules
the reset task.
Fixes: 3ccd54ef44eb ("iavf: Fix init state closure on remove")
Fixes: 14756b2ae265 ("iavf: Fix __IAVF_RESETTING state usage")
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions