Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>, Jouni Malinen <j@w1.fi>
Subject: [PATCH] mac80211: fix offchannel TX cookie matching
Date: Tue, 04 Oct 2011 18:27:10 +0200	[thread overview]
Message-ID: <1317745630.6741.26.camel@jlt3.sipsolutions.net> (raw)

From: Johannes Berg <johannes.berg@intel.com>

When I introduced in-kernel off-channel TX I
introduced a bug -- the work can't be canceled
again because the code clear the skb pointer.
Fix this by keeping track separately of whether
TX status has already been reported.

Cc: stable@kernel.org [2.6.38+]
Reported-by: Jouni Malinen <j@w1.fi>
Tested-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/cfg.c         |    2 +-
 net/mac80211/ieee80211_i.h |    1 +
 net/mac80211/status.c      |    2 +-
 net/mac80211/work.c        |    2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

--- a/net/mac80211/cfg.c	2011-10-04 10:49:07.000000000 +0200
+++ b/net/mac80211/cfg.c	2011-10-04 18:12:34.000000000 +0200
@@ -1886,7 +1886,7 @@ ieee80211_offchan_tx_done(struct ieee802
 	 * so in that case userspace will have to deal with it.
 	 */
 
-	if (wk->offchan_tx.wait && wk->offchan_tx.frame)
+	if (wk->offchan_tx.wait && !wk->offchan_tx.status)
 		cfg80211_mgmt_tx_status(wk->sdata->dev,
 					(unsigned long) wk->offchan_tx.frame,
 					wk->ie, wk->ie_len, false, GFP_KERNEL);
--- a/net/mac80211/ieee80211_i.h	2011-10-04 10:49:07.000000000 +0200
+++ b/net/mac80211/ieee80211_i.h	2011-10-04 18:11:45.000000000 +0200
@@ -346,6 +346,7 @@ struct ieee80211_work {
 		struct {
 			struct sk_buff *frame;
 			u32 wait;
+			bool status;
 		} offchan_tx;
 	};
 
--- a/net/mac80211/status.c	2011-10-04 10:55:26.000000000 +0200
+++ b/net/mac80211/status.c	2011-10-04 18:12:46.000000000 +0200
@@ -429,7 +429,7 @@ void ieee80211_tx_status(struct ieee8021
 				continue;
 			if (wk->offchan_tx.frame != skb)
 				continue;
-			wk->offchan_tx.frame = NULL;
+			wk->offchan_tx.status = true;
 			break;
 		}
 		rcu_read_unlock();
--- a/net/mac80211/work.c	2011-10-04 18:15:17.000000000 +0200
+++ b/net/mac80211/work.c	2011-10-04 18:15:26.000000000 +0200
@@ -577,7 +577,7 @@ ieee80211_offchannel_tx(struct ieee80211
 		/*
 		 * After this, offchan_tx.frame remains but now is no
 		 * longer a valid pointer -- we still need it as the
-		 * cookie for canceling this work.
+		 * cookie for canceling this work/status matching.
 		 */
 		ieee80211_tx_skb(wk->sdata, wk->offchan_tx.frame);
 



                 reply	other threads:[~2011-10-04 16:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1317745630.6741.26.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=j@w1.fi \
    --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