From: Michael Buesch <mb@bu3sch.de>
To: Dan Williams <dcbw@redhat.com>
Cc: Joonwoo Park <joonwpark81@gmail.com>,
linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: fix races between siwessid and siwencode
Date: Wed, 5 Mar 2008 19:30:14 +0100 [thread overview]
Message-ID: <200803051930.14693.mb@bu3sch.de> (raw)
In-Reply-To: <1204741351.9378.11.camel@localhost.localdomain>
On Wednesday 05 March 2008 19:22:31 Dan Williams wrote:
> On Wed, 2008-03-05 at 18:40 +0900, Joonwoo Park wrote:
> > resolve: http://bughost.org/bugzilla/show_bug.cgi?id=1522
> >
> > The function ieee80211_ioctl_siwencode shouldn't be called if
> > authentication process is not completed.
> > This patch makes the ieee80211_ioctl_siwessid to wait for authentication
> > is completed.
> >
> > Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
> > ---
> > net/mac80211/ieee80211_ioctl.c | 10 +++++++++-
> > 1 files changed, 9 insertions(+), 1 deletions(-)
> >
> > diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
> > index 5024d37..55a29f6 100644
> > --- a/net/mac80211/ieee80211_ioctl.c
> > +++ b/net/mac80211/ieee80211_ioctl.c
> > @@ -391,6 +391,7 @@ static int ieee80211_ioctl_siwessid(struct net_device *dev,
> > if (sdata->vif.type == IEEE80211_IF_TYPE_STA ||
> > sdata->vif.type == IEEE80211_IF_TYPE_IBSS) {
> > int ret;
> > + DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
> > if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) {
> > if (len > IEEE80211_MAX_SSID_LEN)
> > return -EINVAL;
> > @@ -405,8 +406,15 @@ static int ieee80211_ioctl_siwessid(struct net_device *dev,
> > ret = ieee80211_sta_set_ssid(dev, ssid, len);
> > if (ret)
> > return ret;
> > +
> > + set_bit(IEEE80211_STA_REQ_RUN, &sdata->u.sta.request);
> > +
> > ieee80211_sta_req_auth(dev, &sdata->u.sta);
> > - return 0;
> > +
> > + ret = wait_event_interruptible_timeout(wq,
> > + !test_bit(IEEE80211_STA_REQ_RUN, &sdata->u.sta.request),
> > + HZ);
> > + return (ret == HZ) ? 0 : ret;
>
> NAK; setting the SSID should never block for long; it _certainly_
> shouldn't block waiting on other WEXT calls. The association process
> needs to be asynchronous.
Doesn't this also cause a RTNL-lock deadlock?
--
Greetings Michael.
prev parent reply other threads:[~2008-03-05 18:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-05 9:40 [PATCH] mac80211: fix races between siwessid and siwencode Joonwoo Park
2008-03-05 9:48 ` Joonwoo Park
2008-03-05 13:53 ` Helge Hafting
2008-03-05 15:01 ` Tomas Winkler
2008-03-06 14:01 ` Helge Hafting
2008-03-06 14:25 ` Tomas Winkler
2008-03-06 14:30 ` Dan Williams
2008-03-09 11:52 ` Helge Hafting
2008-03-10 15:02 ` Dan Williams
2008-03-05 9:54 ` Johannes Berg
2008-03-05 11:10 ` Joonwoo Park
2008-03-05 11:17 ` Johannes Berg
2008-03-05 18:29 ` Dan Williams
2008-03-05 18:53 ` Tomas Winkler
2008-03-05 19:19 ` Dan Williams
2008-03-05 20:50 ` Tomas Winkler
2008-03-05 21:23 ` Dan Williams
2008-03-05 22:28 ` Tomas Winkler
2008-03-05 23:35 ` Dan Williams
2008-03-05 18:22 ` Dan Williams
2008-03-05 18:30 ` Michael Buesch [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=200803051930.14693.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=dcbw@redhat.com \
--cc=joonwpark81@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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 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).