Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net] ice: Fix race during aux device (un)plugging
Date: Wed, 20 Apr 2022 15:59:42 +0200	[thread overview]
Message-ID: <20220420155942.545b7f58@ceranb> (raw)
In-Reply-To: <Yl+p+7C7JQDj1jt1@unreal>

On Wed, 20 Apr 2022 09:36:43 +0300
Leon Romanovsky <leon@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


      reply	other threads:[~2022-04-20 13:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 16:39 [Intel-wired-lan] [PATCH net] ice: Fix race during aux device (un)plugging Ivan Vecera
2022-04-15 11:12 ` Michal Schmidt
2022-04-15 15:49   ` Ivan Vecera
2022-04-15 17:53     ` Ertman, David M
2022-04-20  6:36     ` Leon Romanovsky
2022-04-20 13:59       ` Ivan Vecera [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220420155942.545b7f58@ceranb \
    --to=ivecera@redhat.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox