From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: Tomas Winkler <tomasw@gmail.com>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH 2/6] mac80211: fix sta_info_destroy(NULL)
Date: Mon, 31 Mar 2008 19:23:00 +0200 [thread overview]
Message-ID: <20080331172434.424899000@sipsolutions.net> (raw)
In-Reply-To: 20080331172258.541914000@sipsolutions.net
sta_info_destroy(NULL) should be valid, but currently isn't because
the argument is dereferenced before the NULL check. There are no
users that currently pass in NULL, i.e. all check before calling the
function, but I want to change that.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/sta_info.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- everything.orig/net/mac80211/sta_info.c 2008-03-31 18:21:58.000000000 +0200
+++ everything/net/mac80211/sta_info.c 2008-03-31 18:22:24.000000000 +0200
@@ -129,16 +129,18 @@ struct sta_info *sta_info_get_by_idx(str
void sta_info_destroy(struct sta_info *sta)
{
- struct ieee80211_local *local = sta->local;
+ struct ieee80211_local *local;
struct sk_buff *skb;
int i;
DECLARE_MAC_BUF(mbuf);
+ ASSERT_RTNL();
+ might_sleep();
+
if (!sta)
return;
- ASSERT_RTNL();
- might_sleep();
+ local = sta->local;
rate_control_remove_sta_debugfs(sta);
ieee80211_sta_debugfs_remove(sta);
--
next prev parent reply other threads:[~2008-04-01 11:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-31 17:22 [PATCH 0/6] sta-info fixes, especially destroy() Johannes Berg
2008-03-31 17:22 ` [PATCH 1/6] mac80211 ibss: flush only stations belonging to current interface Johannes Berg
2008-03-31 17:23 ` Johannes Berg [this message]
2008-03-31 17:23 ` [PATCH 3/6] mac80211: automatically free sta struct when insertion fails Johannes Berg
2008-04-01 13:21 ` [PATCH 3/6 v2] " Johannes Berg
2008-03-31 17:23 ` [PATCH 4/6] mac80211: clean up sta_info_destroy() users wrt. RCU/locking Johannes Berg
2008-03-31 17:23 ` [PATCH 5/6] mac80211: sta_info_flush() fixes Johannes Berg
2008-03-31 17:23 ` [PATCH 6/6] mac80211: fix sparse complaint in ieee80211_sta_def_wmm_params Johannes Berg
2008-04-01 21:06 ` [PATCH 0/6] sta-info fixes, especially destroy() Tomas Winkler
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=20080331172434.424899000@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=tomasw@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 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).