All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, Johannes Berg <johannes.berg@intel.com>,
	Nirav Shah <nirav.j2.shah@intel.com>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: [ 26/69] mac80211: clean up remain-on-channel on interface stop
Date: Sun, 17 Jun 2012 19:00:07 +0100	[thread overview]
Message-ID: <20120617175945.029846020@decadent.org.uk> (raw)
In-Reply-To: <20120617175941.281333656@decadent.org.uk>

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

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

commit 71ecfa1893034eeb1c93e02e22ee2ad26d080858 upstream.

When any interface goes down, it could be the one that we
were doing a remain-on-channel with. We therefore need to
cancel the remain-on-channel and flush the related work
structs so they don't run after the interface has been
removed or even destroyed.

It's also possible in this case that an off-channel SKB
was never transmitted, so free it if this is the case.
Note that this can also happen if the driver finishes
the off-channel period without ever starting it.

Reported-by: Nirav Shah <nirav.j2.shah@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/mac80211/iface.c      |   12 ++++++++++++
 net/mac80211/offchannel.c |   16 ++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index d4c19a7..8664111 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -637,6 +637,18 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 		ieee80211_configure_filter(local);
 		break;
 	default:
+		mutex_lock(&local->mtx);
+		if (local->hw_roc_dev == sdata->dev &&
+		    local->hw_roc_channel) {
+			/* ignore return value since this is racy */
+			drv_cancel_remain_on_channel(local);
+			ieee80211_queue_work(&local->hw, &local->hw_roc_done);
+		}
+		mutex_unlock(&local->mtx);
+
+		flush_work(&local->hw_roc_start);
+		flush_work(&local->hw_roc_done);
+
 		flush_work(&sdata->work);
 		/*
 		 * When we get here, the interface is marked down.
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index f054e94..935aa4b 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -234,6 +234,22 @@ static void ieee80211_hw_roc_done(struct work_struct *work)
 		return;
 	}
 
+	/* was never transmitted */
+	if (local->hw_roc_skb) {
+		u64 cookie;
+
+		cookie = local->hw_roc_cookie ^ 2;
+
+		cfg80211_mgmt_tx_status(local->hw_roc_dev, cookie,
+					local->hw_roc_skb->data,
+					local->hw_roc_skb->len, false,
+					GFP_KERNEL);
+
+		kfree_skb(local->hw_roc_skb);
+		local->hw_roc_skb = NULL;
+		local->hw_roc_skb_for_status = NULL;
+	}
+
 	if (!local->hw_roc_for_tx)
 		cfg80211_remain_on_channel_expired(local->hw_roc_dev,
 						   local->hw_roc_cookie,



  parent reply	other threads:[~2012-06-17 18:24 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-17 17:59 [ 00/69] 3.2.21-stable review Ben Hutchings
2012-06-17 17:59 ` [ 01/69] drm/i915: Mark the ringbuffers as being in the GTT domain Ben Hutchings
2012-06-17 17:59 ` [ 02/69] drm/i915: hold forcewake around ring hw init Ben Hutchings
2012-06-17 17:59 ` [ 03/69] drm/i915: Unpin the flip target if we fail to queue the flip Ben Hutchings
2012-06-17 17:59 ` [ 04/69] drm/i915: fix up ivb plane 3 pageflips Ben Hutchings
2012-06-18 21:55   ` Herton Ronaldo Krzesinski
2012-06-18 22:10     ` Eugeni Dodonov
2012-06-19  3:59       ` Ben Hutchings
2012-06-19  8:23         ` Daniel Vetter
2012-06-19 11:59           ` Ben Hutchings
2012-06-19 11:45         ` Eugeni Dodonov
2012-06-17 17:59 ` [ 05/69] char/agp: add another Ironlake host bridge Ben Hutchings
2012-06-17 17:59 ` [ 06/69] x86/uv: Fix UV2 BAU legacy mode Ben Hutchings
2012-06-17 17:59 ` [ 07/69] powerpc: Fix kernel panic during kernel module load Ben Hutchings
2012-06-17 17:59 ` [ 08/69] drm/nouveau: determine a value for display_info.bpc if edid doesnt Ben Hutchings
2012-06-17 17:59 ` [ 09/69] drm/nouveau: default to 8bpc for non-LVDS panels if EDID isnt useful Ben Hutchings
2012-06-17 17:59 ` [ 10/69] drm/nouveau/disp: fix dithering not being enabled on some eDP macbooks Ben Hutchings
2012-06-17 17:59 ` [ 11/69] fuse: fix stat call on 32 bit platforms Ben Hutchings
2012-06-17 17:59 ` [ 12/69] x86, MCE, AMD: Make APIC LVT thresholding interrupt optional Ben Hutchings
2012-06-17 17:59 ` [ 13/69] x86/amd: Re-enable CPU topology extensions in case BIOS has disabled it Ben Hutchings
2012-06-17 17:59 ` [ 14/69] hwmon: (fam15h_power) Increase output resolution Ben Hutchings
2012-06-17 17:59 ` [ 15/69] sched: Fix the relax_domain_level boot parameter Ben Hutchings
2012-06-17 17:59 ` [ 16/69] iwlwifi: dont mess up the SCD when removing a key Ben Hutchings
2012-06-17 17:59 ` [ 17/69] hwrng: atmel-rng - fix race condition leading to repeated bits Ben Hutchings
2012-06-17 17:59   ` Ben Hutchings
2012-06-17 17:59 ` [ 18/69] crypto: aesni-intel - fix unaligned cbc decrypt for x86-32 Ben Hutchings
2012-06-17 17:59   ` Ben Hutchings
2012-06-17 18:00 ` [ 19/69] xen/setup: filter APERFMPERF cpuid feature out Ben Hutchings
2012-06-17 18:00 ` [ 20/69] NFSv4.1: Fix a request leak on the back channel Ben Hutchings
2012-06-17 18:00 ` [ 21/69] can: c_can: fix "BUG! echo_skb is occupied!" during transmit Ben Hutchings
2012-06-17 18:00 ` [ 22/69] can: c_can: fix an interrupt thrash issue with c_can driver Ben Hutchings
2012-06-17 18:00 ` [ 23/69] can: c_can: fix race condition in c_can_open() Ben Hutchings
2012-06-17 18:00 ` [ 24/69] ARM i.MX53: Fix PLL4 base address Ben Hutchings
2012-06-17 18:00 ` [ 25/69] usb: musb_gadget: fix crash caused by dangling pointer Ben Hutchings
2012-06-17 18:00 ` Ben Hutchings [this message]
2012-06-17 18:00 ` [ 27/69] rt2x00: use atomic variable for seqno Ben Hutchings
2012-06-17 18:00 ` [ 28/69] iwlwifi: disable WoWLAN if !CONFIG_PM_SLEEP Ben Hutchings
2012-06-17 18:00 ` [ 29/69] ASoC: wm8994: Ensure all AIFnCLK events are run from the _late variants Ben Hutchings
2012-06-17 18:00 ` [ 30/69] ASoC: wm8994: Apply volume updates with clocks enabled Ben Hutchings
2012-06-17 18:00 ` [ 31/69] iwlwifi: unregister LEDs if mac80211 registration fails Ben Hutchings
2012-06-17 18:00 ` [ 32/69] cfg80211: fix interface combinations check Ben Hutchings
2012-06-17 18:00 ` [ 33/69] [SCSI] mpt2sas: Fix unsafe using smp_processor_id() in preemptible Ben Hutchings
2012-06-17 18:00 ` [ 34/69] net: sierra_net: device IDs for Aircard 320U++ Ben Hutchings
2012-06-17 18:00 ` [ 35/69] ARM: imx6: exit coherency when shutting down a cpu Ben Hutchings
2012-06-17 18:00 ` [ 36/69] ARM i.MX imx21ads: Fix overlapping static i/o mappings Ben Hutchings
2012-06-17 18:00 ` [ 37/69] NFSv4: Fix unnecessary delegation returns in nfs4_do_open Ben Hutchings
2012-06-17 18:00 ` [ 38/69] iwlwifi: use correct supported firmware for 6035 and 6000g2 Ben Hutchings
2012-06-17 18:00 ` [ 39/69] iwlwifi: disable the buggy chain extension feature in HW Ben Hutchings
2012-06-18 19:18   ` Herton Ronaldo Krzesinski
2012-06-18 19:23     ` Grumbach, Emmanuel
2012-06-19  3:57       ` Ben Hutchings
2012-06-17 18:00 ` [ 40/69] ALSA: hda - Add codec->no_jack_detect flag Ben Hutchings
2012-06-17 18:00 ` [ 41/69] ALSA: hda - add support for Uniwill ECS M31EI notebook Ben Hutchings
2012-06-17 18:00 ` [ 42/69] ALSA: hda - Suppress auto-mute feature on some machines with ALC861 Ben Hutchings
2012-06-17 18:00 ` [ 43/69] ALSA: hda - Add another jack-detection suppression for ASUS ALC892 Ben Hutchings
2012-06-17 18:00 ` [ 44/69] ALSA: HDA: Pin fixup for Zotac Z68 motherboard Ben Hutchings
2012-06-17 18:00 ` [ 45/69] usb: cdc-wdm: Add device-id for Huawei 3G/LTE modems Ben Hutchings
2012-06-17 20:51   ` Bjørn Mork
2012-06-17 22:51     ` Ben Hutchings
2012-06-17 18:00 ` [ 46/69] USB: cdc-wdm: Add Vodafone/Huawei K5005 support Ben Hutchings
2012-06-17 20:50   ` Bjørn Mork
2012-06-17 18:00 ` [ 47/69] USB: option: " Ben Hutchings
2012-06-17 18:00 ` [ 48/69] USB: qcserial: Add Sierra Wireless device IDs Ben Hutchings
2012-06-17 18:00 ` [ 49/69] USB: ftdi-sio: Add support for RT Systems USB-RTS01 serial adapter Ben Hutchings
2012-06-17 18:00 ` [ 50/69] USB: serial: cp210x: add Optris MS Pro usb id Ben Hutchings
2012-06-17 18:00 ` [ 51/69] USB: serial: sierra: Add support for Sierra Wireless AirCard 320U modem Ben Hutchings
2012-06-17 18:00 ` [ 52/69] USB: option: Updated Huawei K4605 has better id Ben Hutchings
2012-06-17 18:00 ` [ 53/69] USB: mct_u232: Fix incorrect TIOCMSET return Ben Hutchings
2012-06-17 18:00 ` [ 54/69] USB: option: fix port-data abuse Ben Hutchings
2012-06-17 18:00 ` [ 55/69] USB: option: fix memory leak Ben Hutchings
2012-06-17 18:00 ` [ 56/69] USB: option: add more YUGA device ids Ben Hutchings
2012-06-17 18:00 ` [ 57/69] target: Return error to initiator if SET TARGET PORT GROUPS emulation fails Ben Hutchings
2012-06-17 18:00 ` [ 58/69] USB: add NO_D3_DURING_SLEEP flag and revert 151b61284776be2 Ben Hutchings
2012-06-17 18:00 ` [ 59/69] USB: serial: Enforce USB driver and USB serial driver match Ben Hutchings
2012-06-17 18:00 ` [ 60/69] usb-storage: Add 090c:1000 to unusal-devs Ben Hutchings
2012-06-18  8:39   ` Hans de Goede
2012-06-18  9:14     ` Simon Raffeiner
2012-06-18 13:38       ` Ben Hutchings
2012-06-17 18:00 ` [ 61/69] xhci: Fix invalid loop check in xhci_free_tt_info() Ben Hutchings
2012-06-17 18:00 ` [ 62/69] xhci: Dont free endpoints in xhci_mem_cleanup() Ben Hutchings
2012-06-17 18:00 ` [ 63/69] xHCI: Increase the timeout for controller save/restore state operation Ben Hutchings
2012-06-17 18:00 ` [ 64/69] usb: PS3 EHCI QH read work-around Ben Hutchings
2012-06-17 18:00 ` [ 65/69] USB: fix PS3 EHCI systems Ben Hutchings
2012-06-17 18:00 ` [ 66/69] usb: cdc-acm: fix devices not unthrottled on open Ben Hutchings
2012-06-17 18:00 ` [ 67/69] USB: fix gathering of interface associations Ben Hutchings
2012-06-17 18:00 ` [ 68/69] swap: fix shmem swapping when more than 8 areas Ben Hutchings
2012-06-17 18:00 ` [ 69/69] drm/radeon: add some additional 6xx/7xx/EG register init Ben Hutchings
2012-06-17 18:48 ` [ 00/69] 3.2.21-stable review Ben Hutchings

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=20120617175945.029846020@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=nirav.j2.shah@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.