Netdev Archive on
help / color / mirror / Atom feed
From: Johannes Berg <>
To: Dongliang Mu <>
Cc: Kalle Valo <>,
	"David S. Miller" <>,
	Jakub Kicinski <>,
	Luca Coelho <>,
	Ilan Peer <>,,,
	"open list:NETWORKING [GENERAL]" <>,
	linux-kernel <>,
	Dan Carpenter <>
Subject: Re: [PATCH] cfg80211: free the object allocated in wiphy_apply_custom_regulatory
Date: Fri, 23 Jul 2021 11:42:40 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>


On Fri, 2021-07-23 at 17:30 +0800, Dongliang Mu wrote:
> if zhao in the thread is right, we don't need to add this free
> operation to wiphy_free().

Actually, no, that statement is not true.

All that zhao claimed was that the free happens correctly during
unregister (or later), and that is indeed true, since it happens from

 -> wiphy_unregister()
 -> wiphy_regulatory_deregister()

However, syzbot of course is also correct. Abstracting a bit and
ignoring mac80211, the problem is that here we assign it before
wiphy_register(), then wiphy_register() doesn't get called or fails, and
therefore we don't call wiphy_unregister(), only wiphy_free().

Hence the leak.

But you can also easily see from that description that it's not related
to hwsim - we should add a secondary round of cleanups in wiphy_free()
or even move the call to wiphy_regulatory_deregister() into
wiphy_free(), we need to look what else this does to see if we can move
it or not.


  reply	other threads:[~2021-07-23  9:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23  5:09 Dongliang Mu
2021-07-23  5:16 ` Dongliang Mu
2021-07-23  8:37 ` Johannes Berg
2021-07-23  9:13   ` Dongliang Mu
2021-07-23  9:18     ` Johannes Berg
2021-07-23  9:30       ` Dongliang Mu
2021-07-23  9:42         ` Johannes Berg [this message]
2021-07-23  9:59           ` Dongliang Mu
2021-07-23  9:18 ` xiaoqiang zhao
2021-07-23  9:25   ` Dongliang Mu
2021-07-23  9:36     ` xiaoqiang zhao
2021-07-23  9:44       ` Dongliang Mu

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] cfg80211: free the object allocated in wiphy_apply_custom_regulatory' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).