linux/drivers/net/wireless/iwlwifi/mvm
Emmanuel Grumbach 4cd4b50cc2 iwlwifi: mvm: BT Coex - fix a NULL pointer exception
The commit below introduced an unsafe dereference of
mvmvif->phy_ctxt. It can be NULL even if we hold the mutex.
We can be handling a BT Coex notification while the vif has
already been unassigned. This can happen since the BT Coex
notification is hanled asynchronuously: we can have started
to handle the BT Coex notification trying to acquire the
mutex while the unassign flow already got it. The BT Coex
notification handling will wait for the mutext. I'll get it
later, but then mvmvif->phy_ctxt will be NULL.

Panic log:

BUG: unable to handle kernel NULL pointer dereference at   (null)
IP: [<f985180d>] iwl_mvm_bt_notif_iterator+0x9d/0x340 [iwlmvm]
*pdpt = 0000000000000000 *pde = f000eef300000007
Oops: 0000 [#1] SMP
Workqueue: events iwl_mvm_async_handlers_wk [iwlmvm]
task: ed719b20 ti: ec03e000 task.ti: ec03e000
EIP: 0060:[<f985180d>] EFLAGS: 00010202 CPU: 2
EIP is at iwl_mvm_bt_notif_iterator+0x9d/0x340 [iwlmvm]
EAX: 00000000 EBX: f6d3cb70 ECX: f6d3cb70 EDX: 00000000
ESI: ec03fe40 EDI: efeb8810 EBP: ec03fdf0 ESP: ec03fdac
 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
CR0: 80050033 CR2: 00000000 CR3: 01a1a000 CR4: 001407f0
Stack:
 f743ca80 f744a404 ec03fdcc c10e3952 00003aba f743ca80 00000246 f743ca80
 00000246 00000000 00000001 00000000 ebd45ff6 ebd458a4 f6d3c500 ebd45578
 ebd44b01 ec03fe18 f99e1bc2 00000002 ebd44bc0 f9851770 00000000 f6d3c500
Call Trace:
 [<c10e3952>] ? ring_buffer_unlock_commit+0xa2/0xd0
 [<f99e1bc2>] __iterate_interfaces+0x82/0x110 [mac80211]
 [<f9851770>] ? iwl_mvm_bt_coex_reduced_txp+0x140/0x140 [iwlmvm]
 [<f99e1c6a>] ieee80211_iterate_active_interfaces_atomic+0x1a/0x20 [mac80211]
 [<f9851427>] iwl_mvm_bt_coex_notif_handle+0x77/0x280 [iwlmvm]
 [<f9852161>] iwl_mvm_rx_bt_coex_notif_old+0x211/0x220 [iwlmvm]
 [<f9850b8b>] iwl_mvm_rx_bt_coex_notif+0x19b/0x1b0 [iwlmvm]
 [<f983944f>] iwl_mvm_async_handlers_wk+0x7f/0xe0 [iwlmvm]

CC: <stable@vger.kernel.org> [3.19+]
Fixes: 123f515635 ("iwlwifi: mvm: BT Coex - add support for TTC / RRC")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-05 14:13:20 +02:00
..
binding.c
coex_legacy.c iwlwifi: mvm: BT Coex - fix a NULL pointer exception 2015-03-05 14:13:20 +02:00
coex.c iwlwifi: mvm: BT Coex - fix a NULL pointer exception 2015-03-05 14:13:20 +02:00
constants.h iwlwifi: mvm: reduce quota threshold 2015-02-03 09:01:44 +02:00
d3.c iwlwifi: mvm: use iwl_mvm_sta_from_mac80211() consistently 2014-12-28 20:04:34 +02:00
debugfs-vif.c iwlwifi: mvm: add debugfs file for misbehaving U-APSD AP 2015-01-22 17:54:03 +02:00
debugfs.c iwlwifi: mvm: generate statistics debugfs code 2015-01-22 17:54:08 +02:00
debugfs.h iwlwifi: add Intel Mobile Communications copyright 2014-09-03 22:49:07 +03:00
fw-api-coex.h iwlwifi: mvm: BT Coex - add support for TTC / RRC 2014-11-23 20:05:06 +02:00
fw-api-d3.h iwlwifi: mvm: remove IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID 2014-12-01 12:04:38 +02:00
fw-api-mac.h
fw-api-power.h iwlwifi: mvm: add support for new LTR command 2015-01-22 17:55:16 +02:00
fw-api-rs.h iwlwifi: mvm: rs: enable forcing single stream Tx decision 2015-02-01 15:39:29 +02:00
fw-api-scan.h iwlwifi: mvm: fix EBS on single scan 2015-01-12 09:56:19 +02:00
fw-api-sta.h iwlwifi: add Intel Mobile Communications copyright 2014-09-03 22:49:07 +03:00
fw-api-stats.h iwlwifi: mvm: generate statistics debugfs code 2015-01-22 17:54:08 +02:00
fw-api-tx.h iwlwifi: mvm: let the firmware configure the scheduler 2015-01-22 17:54:02 +02:00
fw-api.h iwlwifi: mvm: move statistics API to new header file 2015-01-22 17:54:07 +02:00
fw.c iwlwifi: mvm: don't send a command the firmware doesn't know 2015-02-02 20:07:36 +02:00
led.c
mac80211.c iwlwifi: mvm: disable beamformer unless FW supports it 2015-02-23 22:48:48 +02:00
mac-ctxt.c iwlwifi: allow to define the stuck queue timer per queue 2015-02-01 15:57:23 +02:00
Makefile iwlwifi: mvm: move TDLS code to separate file 2014-09-14 22:02:24 +03:00
mvm.h iwlwifi: allow to define the stuck queue timer per queue 2015-02-01 15:57:23 +02:00
nvm.c iwlwifi: mvm: support family 8000 C step 2015-01-22 17:55:20 +02:00
offloading.c iwlwifi: mvm: remove IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID 2014-12-01 12:04:38 +02:00
ops.c iwlwifi: mvm: Fix a few EBS error handling bugs 2015-02-01 15:57:23 +02:00
phy-ctxt.c iwlwifi: mvm: fix rx chains configuration in phy ctxt cmd 2015-01-22 22:17:22 +02:00
power.c iwlwifi: mvm: Fix the keep_alive calculation 2014-11-23 19:59:19 +02:00
quota.c iwlwifi: mvm: fix quota update avoidance 2014-09-14 22:02:23 +03:00
rs.c iwlwifi: mvm: rs: fix BT Coex check to look at the correct ant 2015-02-23 22:10:38 +02:00
rs.h iwlwifi: mvm: rs: enable forcing single stream Tx decision 2015-02-01 15:39:29 +02:00
rx.c iwlwifi: mvm: rs: remove stats argument from functions 2015-01-22 17:55:25 +02:00
scan.c iwlwifi: mvm: call ieee80211_scan_completed() even if scan abort fails 2015-02-23 22:07:29 +02:00
sf.c iwlwifi: mvm: allow preventing dummy notifications 2014-09-14 12:56:37 +03:00
sta.c iwlwifi: allow to define the stuck queue timer per queue 2015-02-01 15:57:23 +02:00
sta.h iwlwifi: mvm: add CSA absent time event for clients 2014-11-24 08:30:31 +02:00
tdls.c iwlwifi: mvm: ignore stale TDLS ch-switch responses 2015-02-01 15:57:22 +02:00
testmode.h iwlwifi: add Intel Mobile Communications copyright 2014-09-03 22:49:07 +03:00
time-event.c iwlwifi: mvm: Fix ROC removal 2015-02-23 22:42:37 +02:00
time-event.h iwlwifi: mvm: add remove flow for AUX ROC time events 2014-11-24 08:30:14 +02:00
tt.c iwlwifi: mvm: clear tt values when entering CT-kill 2014-12-28 20:00:15 +02:00
tx.c Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next 2015-01-22 17:55:12 +02:00
utils.c iwlwifi: allow to define the stuck queue timer per queue 2015-02-01 15:57:23 +02:00