From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 3.10 017/103] mac80211: fix suspend vs. authentication race
Date: Wed, 4 Jun 2014 16:24:40 -0700 [thread overview]
Message-ID: <20140604232547.385664294@linuxfoundation.org> (raw)
In-Reply-To: <20140604232546.704156131@linuxfoundation.org>
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
commit 1a1cb744de160ee70086a77afff605bbc275d291 upstream.
Since Stanislaw's patch removing the quiescing code, mac80211 had
a race regarding suspend vs. authentication: as cfg80211 doesn't
track authentication attempts, it can't abort them. Therefore the
attempts may be kept running while suspending, which can lead to
all kinds of issues, in at least some cases causing an error in
iwlmvm firmware.
Fix this by aborting the authentication attempt when suspending.
Cc: stable@vger.kernel.org
Fixes: 12e7f517029d ("mac80211: cleanup generic suspend/resume procedures")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/mlme.c | 26 ++++++++++++++++++++++++++
net/mac80211/pm.c | 14 +++++++++++---
3 files changed, 38 insertions(+), 3 deletions(-)
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1270,6 +1270,7 @@ void ieee80211_sta_reset_conn_monitor(st
void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata);
void ieee80211_mgd_conn_tx_status(struct ieee80211_sub_if_data *sdata,
__le16 fc, bool acked);
+void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata);
void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata);
/* IBSS code */
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3754,6 +3754,32 @@ static void ieee80211_restart_sta_timer(
}
#ifdef CONFIG_PM
+void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata)
+{
+ struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
+ u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
+
+ mutex_lock(&ifmgd->mtx);
+
+ if (ifmgd->auth_data) {
+ /*
+ * If we are trying to authenticate while suspending, cfg80211
+ * won't know and won't actually abort those attempts, thus we
+ * need to do that ourselves.
+ */
+ ieee80211_send_deauth_disassoc(sdata,
+ ifmgd->auth_data->bss->bssid,
+ IEEE80211_STYPE_DEAUTH,
+ WLAN_REASON_DEAUTH_LEAVING,
+ false, frame_buf);
+ ieee80211_destroy_auth_data(sdata, false);
+ cfg80211_send_deauth(sdata->dev, frame_buf,
+ IEEE80211_DEAUTH_FRAME_LEN);
+ }
+
+ mutex_unlock(&ifmgd->mtx);
+}
+
void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -101,10 +101,18 @@ int __ieee80211_suspend(struct ieee80211
/* remove all interfaces that were created in the driver */
list_for_each_entry(sdata, &local->interfaces, list) {
- if (!ieee80211_sdata_running(sdata) ||
- sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
- sdata->vif.type == NL80211_IFTYPE_MONITOR)
+ if (!ieee80211_sdata_running(sdata))
continue;
+ switch (sdata->vif.type) {
+ case NL80211_IFTYPE_AP_VLAN:
+ case NL80211_IFTYPE_MONITOR:
+ continue;
+ case NL80211_IFTYPE_STATION:
+ ieee80211_mgd_quiesce(sdata);
+ break;
+ default:
+ break;
+ }
drv_remove_interface(local, sdata);
}
next prev parent reply other threads:[~2014-06-04 23:48 UTC|newest]
Thread overview: 99+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 23:24 [PATCH 3.10 000/103] 3.10.42-stable review Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 001/103] futex: Add another early deadlock detection check Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 002/103] futex: Prevent attaching to kernel threads Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 003/103] mips: dts: Fix missing device_type="memory" property in memory nodes Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 004/103] ftrace/module: Hardcode ftrace_module_init() call into load_module() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 008/103] pata_at91: fix ata_host_activate() failure handling Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 010/103] mm: make fixup_user_fault() check the vma access rights too Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 011/103] serial: 8250: Fix thread unsafe __dma_tx_complete function Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 012/103] 8250_core: Fix unwanted TX chars write Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 013/103] gpu: host1x: handle the correct # of syncpt regs Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 014/103] timer: Prevent overflow in apply_slack Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 015/103] ipmi: Fix a race restarting the timer Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 016/103] ipmi: Reset the KCS timeout when starting error recovery Greg Kroah-Hartman
2014-06-04 23:24 ` Greg Kroah-Hartman [this message]
2014-06-04 23:24 ` [PATCH 3.10 018/103] mm, thp: close race between mremap() and split_huge_page() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 019/103] x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 020/103] hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 021/103] mac80211: fix on-channel remain-on-channel Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 022/103] hwmon: (emc1403) fix inverted store_hyst() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 023/103] hwmon: (emc1403) Support full range of known chip revision numbers Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 024/103] drivercore: deferral race condition fix Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 025/103] hrtimer: Prevent all reprogramming if hang detected Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 026/103] hrtimer: Prevent remote enqueue of leftmost timers Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 027/103] hrtimer: Set expiry time before switch_hrtimer_base() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 028/103] md: avoid possible spinning md thread at shutdown Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 029/103] drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 032/103] drm/tegra: Remove gratuitous pad field Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 033/103] iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 034/103] fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6 Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 035/103] usb: gadget: at91-udc: fix irq and iomem resource retrieval Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 038/103] usb: storage: shuttle_usbat: fix discs being detected twice Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 039/103] USB: Nokia 305 should be treated as unusual dev Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 040/103] USB: Nokia 5300 " Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 041/103] rt2x00: fix beaconing on USB Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 042/103] ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 043/103] Bluetooth: Fix triggering BR/EDR L2CAP Connect too early Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 044/103] Bluetooth: Fix redundant encryption request for reauthentication Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 045/103] Bluetooth: Add support for Lite-on [04ca:3007] Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 046/103] posix_acl: handle NULL ACL in posix_acl_equiv_mode Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 047/103] [media] omap3isp: Defer probe when the IOMMU is not available Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 048/103] ARM: dts: i.MX53: Fix ipu register space size Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 049/103] ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 050/103] rtl8192cu: Fix unbalanced irq enable in error path of rtl92cu_hw_init() Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 051/103] drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 053/103] leds: leds-pwm: properly clean up after probe failure Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 054/103] brcmsmac: fix deadlock on missing firmware Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 055/103] Documentation: Update stable address in Chinese and Japanese translations Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 056/103] crypto: crypto_wq - Fix late crypto work queue initialization Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 057/103] clk: vexpress: NULL dereference on error path Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 059/103] i2c: i801: Add Device IDs for Intel Wildcat Point-LP PCH Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 060/103] i2c: i801: enable Intel BayTrail SMBUS Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 061/103] Drivers: hv: vmbus: Negotiate version 3.0 when running on ws2012r2 hosts Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 062/103] trace: module: Maintain a valid user count Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 063/103] Input: atkbd - fix keyboard not working on some LG laptops Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 064/103] Input: elantech - fix touchpad initialization on Gigabyte U2442 Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 065/103] Input: synaptics - add min/max quirk for the ThinkPad W540 Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 066/103] Input: synaptics - T540p - unify with other LEN0034 models Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 067/103] ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 068/103] NFSd: Move default initialisers from create_client() to alloc_client() Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 069/103] NFSd: call rpc_destroy_wait_queue() from free_client() Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 070/103] NFSD: Call ->set_acl with a NULL ACL structure if no entries Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 071/103] nfsd4: warn on finding lockowner without stateids Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 072/103] nfsd4: remove lockowner when removing lock stateid Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 073/103] workqueue: fix bugs in wq_update_unbound_numa() failure path Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 074/103] workqueue: fix a possible race condition between rescuer and pwq-release Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 075/103] workqueue: make rescuer_thread() empty wq->maydays list before exiting Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 076/103] bus: mvebu-mbus: allow several windows with the same target/attribute Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 077/103] percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree() Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 080/103] ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 081/103] metag: fix memory barriers Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 082/103] metag: Reduce maximum stack size to 256MB Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 083/103] x86-64, modify_ldt: Make support for 16-bit segments a runtime option Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 084/103] genirq: Provide irq_force_affinity fallback for non-SMP Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 085/103] PCI: shpchp: Check bridges secondary (not primary) bus speed Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 086/103] Target/iser: Fix wrong connection requests list addition Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 087/103] Target/iser: Fix iscsit_accept_np and rdma_cm racy flow Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 088/103] target: Dont allow setting WC emulation if device doesnt support Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 089/103] powerpc/tm: Fix crash when forking inside a transaction Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 090/103] dm crypt: fix cpu hotplug crash by removing per-cpu structure Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 091/103] libata: clean up ZPODD when a port is detached Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 092/103] ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC 1015PX Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 093/103] i2c: rcar: bail out on zero length transfers Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 094/103] i2c: designware: Mask all interrupts during i2c controller enable Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 095/103] i2c: s3c2410: resume race fix Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 096/103] crypto: caam - add allocation failure handling in SPRINTFCAT macro Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 097/103] crypto: s390 - fix aes,des ctr mode concurrency finding Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 098/103] powerpc: Fix 64 bit builds with binutils 2.24 Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 099/103] libceph: fix corruption when using page_count 0 page in rbd Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 100/103] iommu/amd: Fix interrupt remapping for aliased devices Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 101/103] media: fc2580: fix tuning failure on 32-bit arch Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 102/103] media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 103/103] media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode Greg Kroah-Hartman
[not found] ` <20140604232547.006861681@linuxfoundation.org>
2014-06-05 16:05 ` [PATCH 3.10 005/103] irqchip: Gic: Support forced affinity setting Mark Rutland
2014-06-05 18:05 ` Greg Kroah-Hartman
2014-06-05 18:10 ` Mark Rutland
2014-06-23 11:17 ` Mark Brown
2014-06-05 17:15 ` [PATCH 3.10 000/103] 3.10.42-stable review Guenter Roeck
2014-06-05 17:55 ` Shuah Khan
2014-06-05 23:20 ` Greg Kroah-Hartman
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=20140604232547.385664294@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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