All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Neumann <s.neumann@raumfeld.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: libertas-dev@lists.infradead.org, daniel@zonque.org,
	linux-wireless@vger.kernel.org, mcgrof@gmail.com
Subject: Re: [PATCH] cfg80211: hold reg_mutex when updating regulatory
Date: Fri, 22 Jul 2011 22:37:55 +0200	[thread overview]
Message-ID: <1311367076.27468.4.camel@bender> (raw)
In-Reply-To: <20110715173240.GD2566@tuxdriver.com>

Hi,

On Fri, 2011-07-15 at 13:32 -0400, John W. Linville wrote:
> Luis, any comment on this?
> 
> On Tue, Jul 12, 2011 at 09:52:39AM +0200, Sven Neumann wrote:
> > The function wiphy_update_regulatory() uses the static variable
> > last_request and thus needs to be called with reg_mutex held.
> > This is the case for all users in reg.c, but the function was
> > exported for use by wiphy_register(), from where it is called
> > without the lock being held.
> > 
> > Fix this by making wiphy_update_regulatory() private and introducing
> > regulatory_update() as a wrapper that acquires and holds the lock.
> > 
> > Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>

I'd appreciate if someone would review this patch. But probably this is
not really an issue except that it's somewhat ugly to export a function
that should be called with a lock held and that lock is actually
private. But in this particular case it is not a problem, as far as I
can see, since the only user of wiphy_update_regulatory() outside
net/wireless/reg.c is initialization code. So there is not likely going
to be a race condition here.


Sven



  reply	other threads:[~2011-07-22 20:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12  7:43 patch to fix potential problem with wiphy_update_regulatory Sven Neumann
2011-07-12  7:43 ` [PATCH] cfg80211: hold reg_mutex when updating regulatory Sven Neumann
2011-07-12  7:52 ` patch to fix potential problem with wiphy_update_regulatory (update) Sven Neumann
2011-07-12  7:52 ` [PATCH] cfg80211: hold reg_mutex when updating regulatory Sven Neumann
2011-07-15 17:32   ` John W. Linville
2011-07-22 20:37     ` Sven Neumann [this message]
2011-07-25 20:21       ` Luis R. Rodriguez
2011-07-31  8:24         ` Sven Neumann
2011-08-30 19:14           ` John W. Linville
2011-08-30 21:38             ` [PATCH 1/2] " Sven Neumann
2011-08-30 21:38               ` [PATCH 2/2] cfg80211: reorder code to obsolete forward declaration Sven Neumann
2011-08-30 22:25                 ` Luis R. Rodriguez
2011-08-30 22:24               ` [PATCH 1/2] cfg80211: hold reg_mutex when updating regulatory Luis R. Rodriguez

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=1311367076.27468.4.camel@bender \
    --to=s.neumann@raumfeld.com \
    --cc=daniel@zonque.org \
    --cc=libertas-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.