From: "John W. Linville" <linville@tuxdriver.com>
To: David LAMPARTER <lists@diac24.net>
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: Panic in ieee_80211_ibss_add_sta when trying to join ad-hoc network (rt2500pci)
Date: Tue, 15 May 2007 13:12:02 -0400 [thread overview]
Message-ID: <20070515171202.GD15105@tuxdriver.com> (raw)
In-Reply-To: <20070515152842.GA26481@charon.n2.diac24.net>
On Tue, May 15, 2007 at 05:28:42PM +0200, David LAMPARTER wrote:
> BUG: unable to handle kernel NULL pointer derference at virtual address 00000218
> [...]
> EIP is at ieee80211_ibss_add_sta+0xae/0x130
> [...]
> EIP: [<c05773fe>] ieee_80211_ibss_add_sta+0xae/0x130 SS:ESP 0068:f641dc38
> Kernel panic - not syncing: Fatal exception in interrupt
>
> The bug seems to be triggered as soon as the stack tries to
> join my router's ad-hoc; it happen either directly when
> doing "ip l s wlan0 up" as well as when doing
> "iwconfig wlan0 essid equinox" (when it did not immediately
> find the network).
Probably because of this:
struct ieee80211_sub_if_data *sdata = NULL;
...
sta->supp_rates = sdata->u.sta.supp_rates_bits;
Patch below...does this work better? Looks like upstream needs
it too...
John
---
Avoid sdata null pointer dereference in ieee80211_ibss_add_sta.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
net/mac80211/ieee80211_sta.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index a36c6f3..dd36cc6 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -3154,7 +3154,7 @@ struct sta_info * ieee80211_ibss_add_sta(struct net_device *dev,
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct sta_info *sta;
- struct ieee80211_sub_if_data *sdata = NULL;
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
/* TODO: Could consider removing the least recently used entry and
* allow new one to be added. */
--
John W. Linville
linville@tuxdriver.com
next prev parent reply other threads:[~2007-05-15 17:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-15 15:28 Panic in ieee_80211_ibss_add_sta when trying to join ad-hoc network (rt2500pci) David LAMPARTER
2007-05-15 17:12 ` John W. Linville [this message]
2007-05-15 18:52 ` Michael Wu
2007-05-15 19:33 ` mac80211 ad-hoc: carrier not set up [was: Panic in ieee_80211_ibss_add_sta] David Lamparter
2007-05-15 21:59 ` Ivo van Doorn
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=20070515171202.GD15105@tuxdriver.com \
--to=linville@tuxdriver.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lists@diac24.net \
--cc=netdev@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).