Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Przemek Kitszel
Fri, 27 Nov 2026 14:50
Re: [PATCH net v5 1/4] ice: stop the service task before the PF is unloaded
Author: Przemek Kitszel
Date: Fri, 27 Nov 2026 14:50
Date: Fri, 27 Nov 2026 14:50
66 lines
23486 bytes
23486 bytes
On 11/27/26 9:57 AM, Petr Oros wrote:
> Commit 8a37f9e2ff40 ("ice: move ice_deinit_dev() to the end of deinit
> paths") moved the service task stop and the cancel of the AdminQ event
> waiters from after ice_free_vfs() to the end of ice_remove(). Since then
> a queued or running service task can still walk pf->vsi[] while
> ice_remove_arfs(), ice_unload() and ice_deinit() free the aRFS filters,
> the netdev, the LAG and the VSIs. A last run that takes longer than a
> timer period also arms the service timer again after the stop at the
> end has deleted it, and the timer then fires after the PF is freed.
>
> Stop the service task and cancel the waiters after ice_free_vfs() again.
> The stop in ice_deinit_dev() stays and deletes a timer armed by the last
> run. As before that commit, a devlink flash that is still running when
> the driver is removed fails, at the latest when its next AdminQ wait
> times out.
>
> Found by AI code review. Validated on an E810-C (FW 8.1.1, ICE COMMS
> package 1.3.55.0) with a test-only 12 s delay in ice_sync_fltr_subtask()
> after it took the VSI pointer, armed right before a promisc change and
> rmmod ice. Without this patch KASAN reports a slab-use-after-free in
> ice_vsi_fltr_changed() on the freed main VSI, and the kernel then faults
> in call_timer_fn() on the timer function of the unloaded module. With it
> rmmod waits for the run and nothing is reported. Also tested by removing
> the driver during switchdev sessions and with four VFs bound to iavf. No
> kernel selftests cover this.
>
> Fixes: 8a37f9e2ff40 ("ice: move ice_deinit_dev() to the end of deinit paths")
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---
> v5:
> - New patch. The uplink resync in patch 3 queues a filter sync when a
> switchdev session ends, and a session that still runs when the driver
> is removed ends in ice_remove().
> ---
> drivers/net/ethernet/intel/ice/ice_main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 47c6798c97e8f1..6dede87b78944f 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -5387,6 +5387,9 @@ static void ice_remove(struct pci_dev *pdev)
> ice_free_vfs(pf);
> }
>
> + ice_service_task_stop(pf);
> + ice_aq_cancel_waiting_tasks(pf);
> +
makes sense, thank you!
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
(would be fine for me to pick this particular patch directly to netdev
too, have not read the rest of the series through)
> if (!ice_is_safe_mode(pf))
> ice_remove_arfs(pf);
>
> @@ -5407,7 +5410,6 @@ static void ice_remove(struct pci_dev *pdev)
> ice_deinit_hw(&pf->hw);
>
> ice_deinit_dev(pf);
> - ice_aq_cancel_waiting_tasks(pf);
> set_bit(ICE_DOWN, pf->state);
> }
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads