linux/drivers/net/wireless/iwlwifi/dvm
Stanislaw Gruszka 9186a1fd9e iwlwifi: dvm: fix calling ieee80211_chswitch_done() with NULL
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

Cc: stable@vger.kernel.org
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>
2013-07-31 08:54:25 +02:00
..
agn.h iwlwifi: remove testmode 2013-06-18 11:51:57 +02:00
calib.c iwlwifi: move some configuration parameters into DVM 2013-05-27 13:11:42 +02:00
calib.h iwlwifi: a few fixes in license 2013-03-06 16:46:59 +01:00
commands.h Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2013-05-29 14:51:50 -04:00
debugfs.c iwlwifi: remove unneeded goto from iwl_dbgfs_log_event_read 2013-04-18 13:34:30 +02:00
dev.h Merge remote-tracking branch 'wireless-next/master' into iwlwifi-next 2013-06-25 12:20:16 +02:00
devices.c iwlwifi: dvm: constify configuration structs 2013-05-27 13:12:51 +02:00
led.c iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
led.h iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
lib.c iwlwifi: remove testmode 2013-06-18 11:51:57 +02:00
mac80211.c iwlwifi: dvm: fix calling ieee80211_chswitch_done() with NULL 2013-07-31 08:54:25 +02:00
main.c iwlwifi: dvm: don't send BT_CONFIG on devices w/o Bluetooth 2013-07-16 13:55:05 +03:00
Makefile iwlwifi: remove testmode 2013-06-18 11:51:57 +02:00
power.c iwlwifi: move some configuration parameters into DVM 2013-05-27 13:11:42 +02:00
power.h iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
rs.c Merge remote-tracking branch 'wireless-next/master' into iwlwifi-next 2013-06-25 12:20:16 +02:00
rs.h iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
rx.c iwlwifi: remove testmode 2013-06-18 11:51:57 +02:00
rxon.c iwlwifi: dvm: fix chain noise calibration 2013-06-04 13:14:08 +02:00
scan.c iwlwifi: move some configuration parameters into DVM 2013-05-27 13:11:42 +02:00
sta.c iwlwifi: dvm: fix zero LQ CMD sending avoidance 2013-05-27 11:33:57 +02:00
tt.c iwlwifi: move some configuration parameters into DVM 2013-05-27 13:11:42 +02:00
tt.h iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
tx.c iwlwifi: remove testmode 2013-06-18 11:51:57 +02:00
ucode.c iwlwifi: move some configuration parameters into DVM 2013-05-27 13:11:42 +02:00