All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
To: linux-wireless@vger.kernel.org
Cc: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Subject: [PATCH] mac80211: Fix double locking on CSA counter update
Date: Mon,  1 Jun 2015 15:54:16 +0200	[thread overview]
Message-ID: <1433166856-3285-1-git-send-email-Wojciech.Dubowik@neratec.com> (raw)

We call rcu locked ieee80211_csa_update_counter from
already locked section. Fix it by decrementing counter
directly instead of calling ieee80211_csa_update_counter.

Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
---
 net/mac80211/tx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 8df1342..9233559 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3338,7 +3338,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw,
 		if (beacon) {
 			if (beacon->csa_counter_offsets[0]) {
 				if (!is_template)
-					ieee80211_csa_update_counter(vif);
+					WARN_ON_ONCE(beacon->csa_current_counter--);
 
 				ieee80211_set_csa(sdata, beacon);
 			}
@@ -3384,7 +3384,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw,
 
 		if (beacon->csa_counter_offsets[0]) {
 			if (!is_template)
-				ieee80211_csa_update_counter(vif);
+				WARN_ON_ONCE(beacon->csa_current_counter--);
 
 			ieee80211_set_csa(sdata, beacon);
 		}
@@ -3414,7 +3414,7 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw,
 				 * for now we leave it consistent with overall
 				 * mac80211's behavior.
 				 */
-				ieee80211_csa_update_counter(vif);
+				WARN_ON_ONCE(beacon->csa_current_counter--);
 
 			ieee80211_set_csa(sdata, beacon);
 		}
-- 
1.9.1


             reply	other threads:[~2015-06-01 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 13:54 Wojciech Dubowik [this message]
2015-06-01 14:13 ` [PATCH] mac80211: Fix double locking on CSA counter update Julian Calaby
2015-06-01 14:23   ` Wojciech Dubowik
2015-06-01 14:40     ` Johannes Berg

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=1433166856-3285-1-git-send-email-Wojciech.Dubowik@neratec.com \
    --to=wojciech.dubowik@neratec.com \
    --cc=linux-wireless@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 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.