mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kamal Mostafa <kamal@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: Stanislaw Gruszka <sgruszka@redhat.com>,
	Johannes Berg <johannes.berg@intel.com>,
	Kamal Mostafa <kamal@canonical.com>
Subject: [PATCH 34/58] iwlwifi: dvm: fix calling ieee80211_chswitch_done() with NULL
Date: Tue,  3 Sep 2013 09:23:38 -0700	[thread overview]
Message-ID: <1378225442-20654-35-git-send-email-kamal@canonical.com> (raw)
In-Reply-To: <1378225442-20654-1-git-send-email-kamal@canonical.com>

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

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

From: Stanislaw Gruszka <sgruszka@redhat.com>

commit 9186a1fd9ed190739423db84bc344d258ef3e3d7 upstream.

If channel switch is pending and we remove interface we can
crash like showed below due to passing NULL vif to mac80211:

BUG: unable to handle kernel paging request at fffffffffffff8cc
IP: [<ffffffff8130924d>] strnlen+0xd/0x40
Call Trace:
 [<ffffffff8130ad2e>] string.isra.3+0x3e/0xd0
 [<ffffffff8130bf99>] vsnprintf+0x219/0x640
 [<ffffffff8130c481>] vscnprintf+0x11/0x30
 [<ffffffff81061585>] vprintk_emit+0x115/0x4f0
 [<ffffffff81657bd5>] printk+0x61/0x63
 [<ffffffffa048987f>] ieee80211_chswitch_done+0xaf/0xd0 [mac80211]
 [<ffffffffa04e7b34>] iwl_chswitch_done+0x34/0x40 [iwldvm]
 [<ffffffffa04f83c3>] iwlagn_commit_rxon+0x2a3/0xdc0 [iwldvm]
 [<ffffffffa04ebc50>] ? iwlagn_set_rxon_chain+0x180/0x2c0 [iwldvm]
 [<ffffffffa04e5e76>] iwl_set_mode+0x36/0x40 [iwldvm]
 [<ffffffffa04e5f0d>] iwlagn_mac_remove_interface+0x8d/0x1b0 [iwldvm]
 [<ffffffffa0459b3d>] ieee80211_do_stop+0x29d/0x7f0 [mac80211]

This is because we nulify ctx->vif in iwlagn_mac_remove_interface()
before calling some other functions that teardown interface. To fix
just check ctx->vif on iwl_chswitch_done(). We should not call
ieee80211_chswitch_done() as channel switch works were already canceled
by mac80211 in ieee80211_do_stop() -> ieee80211_mgd_stop().

Resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=979581

Reported-by: Lukasz Jagiello <jagiello.lukasz@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/wireless/iwlwifi/dvm/mac80211.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index c784f69..70c32db 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -961,7 +961,10 @@ void iwl_chswitch_done(struct iwl_priv *priv, bool is_success)
 	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
 		return;
 
-	if (test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
+	if (!test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
+		return;
+
+	if (ctx->vif)
 		ieee80211_chswitch_done(ctx->vif, is_success);
 }
 
-- 
1.8.1.2


  parent reply	other threads:[~2013-09-03 16:28 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 16:23 [ 3.8.y.z extended stable ] Linux 3.8.13.8 stable review Kamal Mostafa
2013-09-03 16:23 ` [PATCH 01/58] mac80211: fix infinite loop in ieee80211_determine_chantype Kamal Mostafa
2013-09-03 16:23 ` [PATCH 02/58] cfg80211/mac80211: disconnect on suspend Kamal Mostafa
2013-09-03 16:23 ` [PATCH 03/58] cfg80211: fix P2P GO interface teardown Kamal Mostafa
2013-09-03 16:23 ` [PATCH 04/58] iwl4965: set power mode early Kamal Mostafa
2013-09-03 16:23 ` [PATCH 05/58] iwl4965: reset firmware after rfkill off Kamal Mostafa
2013-09-03 16:23 ` [PATCH 06/58] ASoC: cs42l52: Reorder Min/Max and update to SX_TLV for Beep Volume Kamal Mostafa
2013-09-03 16:23 ` [PATCH 07/58] can: pcan_usb: fix wrong memcpy() bytes length Kamal Mostafa
2013-09-03 16:23 ` [PATCH 08/58] ALSA: 6fire: make buffers DMA-able (pcm) Kamal Mostafa
2013-09-03 16:23 ` [PATCH 09/58] ALSA: 6fire: make buffers DMA-able (midi) Kamal Mostafa
2013-09-03 16:23 ` [PATCH 10/58] jbd2: Fix use after free after error in jbd2_journal_dirty_metadata() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 11/58] USB: EHCI: accept very late isochronous URBs Kamal Mostafa
2013-09-03 16:23 ` [PATCH 12/58] USB-Serial: Fix error handling of usb_wwan Kamal Mostafa
2013-09-03 16:23 ` [PATCH 13/58] USB: mos7840: fix big-endian probe Kamal Mostafa
2013-09-03 16:23 ` [PATCH 14/58] USB: adutux: fix big-endian device-type reporting Kamal Mostafa
2013-09-03 16:23 ` [PATCH 15/58] USB: ti_usb_3410_5052: fix big-endian firmware handling Kamal Mostafa
2013-09-03 16:23 ` [PATCH 16/58] ARM: 7809/1: perf: fix event validation for software group leaders Kamal Mostafa
2013-09-03 16:23 ` [PATCH 17/58] m68k/atari: ARAnyM - Fix NatFeat module support Kamal Mostafa
2013-09-03 16:23 ` [PATCH 18/58] m68k: Truncate base in do_div() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 19/58] usb: add two quirky touchscreen Kamal Mostafa
2013-09-03 16:23 ` [PATCH 20/58] USB: mos7720: fix broken control requests Kamal Mostafa
2013-09-03 16:23 ` [PATCH 21/58] USB: keyspan: fix null-deref at disconnect and release Kamal Mostafa
2013-09-03 16:23 ` [PATCH 22/58] ASoC: tegra: fix Tegra30 I2S capture parameter setup Kamal Mostafa
2013-09-03 16:23 ` [PATCH 23/58] ALSA: hda - Add a fixup for Gateway LT27 Kamal Mostafa
2013-09-03 16:23 ` [PATCH 24/58] mm: fix the TLB range flushed when __tlb_remove_page() runs out of slots Kamal Mostafa
2013-09-03 16:23 ` [PATCH 25/58] arch, mm: Remove tlb_fast_mode() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 26/58] Fix TLB gather virtual address range invalidation corner cases Kamal Mostafa
2013-09-03 16:23 ` [PATCH 27/58] s390: Fix broken build Kamal Mostafa
2013-09-03 16:23 ` [PATCH 28/58] x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member Kamal Mostafa
2013-09-03 16:23 ` [PATCH 29/58] Bluetooth: Add support for Foxconn/Hon Hai [0489:e04d] Kamal Mostafa
2013-09-03 16:23 ` [PATCH 30/58] Bluetooth: ath3k: Add support for Fujitsu Lifebook UH5x2 [04c5:1330] Kamal Mostafa
2013-09-03 16:23 ` [PATCH 31/58] Bluetooth: ath3k: Add support for ID 0x13d3/0x3402 Kamal Mostafa
2013-09-03 16:23 ` [PATCH 32/58] Bluetooth: Add support for Atheros [0cf3:3121] Kamal Mostafa
2013-09-03 16:23 ` [PATCH 33/58] Bluetooth: Add support for Atheros [0cf3:e003] Kamal Mostafa
2013-09-03 16:23 ` Kamal Mostafa [this message]
2013-09-03 16:23 ` [PATCH 35/58] iwlwifi: pcie: disable L1 Active after pci_enable_device Kamal Mostafa
2013-09-03 16:23 ` [PATCH 36/58] zd1201: do not use stack as URB transfer_buffer Kamal Mostafa
2013-09-03 16:23 ` [PATCH 37/58] Hostap: copying wrong data prism2_ioctl_giwaplist() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 38/58] ARM: at91/DT: fix at91sam9n12ek memory node Kamal Mostafa
2013-09-03 16:23 ` [PATCH 39/58] drm/i915: Move num_pipes to intel info Kamal Mostafa
2013-09-03 16:23 ` [PATCH 40/58] drm/i915: Don't deref pipe->cpu_transcoder in the hangcheck code Kamal Mostafa
2013-09-03 16:23 ` [PATCH 41/58] drm/i915: Invalidate TLBs for the rings after a reset Kamal Mostafa
2013-09-03 16:23 ` [PATCH 42/58] libata: apply behavioral quirks to sil3826 PMP Kamal Mostafa
2013-09-03 16:23 ` [PATCH 43/58] ARM: davinci: nand: specify ecc strength Kamal Mostafa
2013-09-03 16:23 ` [PATCH 44/58] ARM: allow kuser helpers to be removed from the vector page Kamal Mostafa
2013-09-03 16:23 ` [PATCH 45/58] ARM: 7816/1: CONFIG_KUSER_HELPERS: fix help text Kamal Mostafa
2013-09-03 16:23 ` [PATCH 46/58] arm64: perf: fix array out of bounds access in armpmu_map_hw_event() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 47/58] arm64: perf: fix event validation for software group leaders Kamal Mostafa
2013-09-03 16:23 ` [PATCH 48/58] sata_fsl: save irqs while coalescing Kamal Mostafa
2013-09-03 16:23 ` [PATCH 49/58] xen/events: initialize local per-cpu mask for all possible events Kamal Mostafa
2013-09-03 16:23 ` [PATCH 50/58] xen/events: mask events when changing their VCPU binding Kamal Mostafa
2013-09-03 16:23 ` [PATCH 51/58] block: Add bio_for_each_segment_all() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 52/58] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal Kamal Mostafa
2013-09-03 16:23 ` [PATCH 53/58] of: fdt: fix memory initialization for expanded DT Kamal Mostafa
2013-09-03 16:23 ` [PATCH 54/58] [SCSI] zfcp: fix lock imbalance by reworking request queue locking Kamal Mostafa
2013-09-03 16:23 ` [PATCH 55/58] [SCSI] zfcp: fix schedule-inside-lock in scsi_device list loops Kamal Mostafa
2013-09-03 16:24 ` [PATCH 56/58] drivers/platform/olpc/olpc-ec.c: initialise earlier Kamal Mostafa
2013-09-03 16:24 ` [PATCH 57/58] nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error Kamal Mostafa
2013-09-03 16:24 ` [PATCH 58/58] nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection Kamal Mostafa

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=1378225442-20654-35-git-send-email-kamal@canonical.com \
    --to=kamal@canonical.com \
    --cc=johannes.berg@intel.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgruszka@redhat.com \
    --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

all inboxes | Powered by JetHome®