[Intel-wired-lan] [PATCH net] ice: Fix race during aux device (un)plugging
Ivan Vecera
ivecera at redhat.com
Wed Apr 20 13:59:42 UTC 2022
On Wed, 20 Apr 2022 09:36:43 +0300
Leon Romanovsky <leon at kernel.org> wrote:
> > ice_send_event_to_aux() takes aux device lock. ice_unplug_aux_dev()
> > calls auxiliary_device_delete() that calls device_del(). device_del()
> > takes device_lock() prior kill_device(). So if ice_send_event_to_aux()
> > is in progress then device_del() waits for its completion.
>
> Not really, you nullify pf->adev without any lock protection and
> ice_send_event_to_aux() will simply crash.
>
> CPU#1 | CPU#2
> | ice_send_event_to_aux
> ice_unplug_aux_dev() | ...
> ... |
> pf->adev = NULL; |
> | device_lock(&pf->adev->dev); <--- crash here.
>
> Thanks
You are right, the window is very tiny but it's still there.
Will send v2.
Thanks,
Ivan
More information about the Intel-wired-lan
mailing list