linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: Re: [PATCH] cfg80211: fix race in netlink owner interface destruction
Date: Tue, 01 Feb 2022 15:03:29 +0100	[thread overview]
Message-ID: <87h79ielam.fsf@toke.dk> (raw)
In-Reply-To: <20220201130951.22093-1-johannes@sipsolutions.net>

Johannes Berg <johannes@sipsolutions.net> writes:

> From: Johannes Berg <johannes.berg@intel.com>
>
> My previous fix here to fix the deadlock left a race where
> the exact same deadlock (see the original commit referenced
> below) can still happen if cfg80211_destroy_ifaces() already
> runs while nl80211_netlink_notify() is still marking some
> interfaces as nl_owner_dead.
>
> The race happens because we have two loops here - first we
> dev_close() all the netdevs, and then we destroy them. If we
> also have two netdevs (first one need only be a wdev though)
> then we can find one during the first iteration, close it,
> and go to the second iteration -- but then find two, and try
> to destroy also the one we didn't close yet.
>
> Fix this by only iterating once.
>
> Change-Id: Ie56cd0ef3f0d2108bb8a25c8bb5efced15e6a909
> Reported-by: Toke Høiland-Jørgensen <toke@redhat.com>
> Fixes: ea6b2098dd02 ("cfg80211: fix locking in netlink owner interface destruction")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Looks like this fixed the crash I was seeing - thanks!

Tested-by: Toke Høiland-Jørgensen <toke@redhat.com>


  reply	other threads:[~2022-02-01 14:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 13:09 [PATCH] cfg80211: fix race in netlink owner interface destruction Johannes Berg
2022-02-01 14:03 ` Toke Høiland-Jørgensen [this message]
2022-02-01 14:35 ` Kalle Valo
2022-02-01 14:36   ` Johannes Berg

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=87h79ielam.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).