From patchwork Tue Feb 12 21:26:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya X-Patchwork-Id: 2132201 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 623BF3FD4F for ; Tue, 12 Feb 2013 21:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752836Ab3BLV1P (ORCPT ); Tue, 12 Feb 2013 16:27:15 -0500 Received: from mail-wi0-f181.google.com ([209.85.212.181]:62729 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752283Ab3BLV1N (ORCPT ); Tue, 12 Feb 2013 16:27:13 -0500 Received: by mail-wi0-f181.google.com with SMTP id hm6so667398wib.14 for ; Tue, 12 Feb 2013 13:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to:cc :content-type; bh=PDbNvbTkrTs0RBqHQUt2ploKgndzQ9VZFv+rfO8VNbo=; b=UD4OvlvQerwHuNuO1D+RoVISVH81qUxx7u5uxKPEoYe3E0jtZvmm+xAKilxzIsoNyl 29K2FsQJst6eKTrOURmWGatXt/cghH1J2qyy9gKx7IQNDUllPJ/Dir8SaA9gvAb4wSF7 NFbShqlmq7Ybh2+lxo3MQ/vMI+vridD46MnCAoZG2PSi7mQt0kvSENpO1JjPbrkyMCpk k/5b5vebOzsnWhzE/19XRbS7c/TLRpMN4ObomoLbjLH87aq++OnIY9McQJ4kOaTiPiZa ZbJxaRGPJTtJngzAyF5xv54RBLYVEqqVf4aLEajT1M8JRBWUAh6ZRd8yKdvP9ixx7jm0 IuRg== X-Received: by 10.180.102.164 with SMTP id fp4mr5973648wib.1.1360704431333; Tue, 12 Feb 2013 13:27:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.235.197 with HTTP; Tue, 12 Feb 2013 13:26:51 -0800 (PST) From: Krishna Chaitanya Date: Wed, 13 Feb 2013 02:56:51 +0530 Message-ID: Subject: [RFC] iwlwifi: Move updating of bssid under the association_changed flag to avoid crash To: Johannes Berg Cc: linux-wireless Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org BSSID from the BSS conf should be updated only when there is a change in association information. This was causing the crash in latest mac80211-next when bringing the interface in monitor mode. (Basically changing the bss_info). Signed-off-by: Chaitanya --- Note1: Will fix the styling issues while submitting the patch. Note2: For monitor mode the flag BSS_CHANGED_ASSOC is not set.So its causing the crash. Crash Information: Latest mac80211-next kernel. kernel: [ 111.497436] BUG: unable to handle kernel NULL pointer dereference at (null) kernel: [ 111.497523] IP: [] iwlagn_bss_info_changed+0x103/0x5a0 [iwldvm] kernel: [ 111.497604] *pdpt = 0000000027f82001 *pde = 0000000000000000 kernel: [ 111.497664] Oops: 0000 [#1] SMP kernel: [ 111.497704] Modules linked in: nfsd nfs_acl auth_rpcgss nfs fscache lockd sunrpc rfcomm bnep binfmt_misc arc4 iwldvm snd_hda_codec_hdmi mac80211 snd_hda_codec_idt i915 iwlwifi snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq_midi snd_rawmidi cfg80211 btusb coretemp snd_seq_midi_event kvm_intel drm_kms_helper snd_seq bluetooth snd_timer lib80211_crypt_tkip snd_seq_device drm wl(PO) kvm snd dell_laptop psmouse soundcore aesni_intel dcdbas ablk_helper dell_wmi cryptd snd_page_alloc lrw i2c_algo_bit aes_i586 lib80211 sparse_keymap serio_raw lpc_ich mei wmi xts ppdev gf128mul parport_pc microcode video lp mac_hid parport tg3 sdhci_pci sdhci ptp pps_core kernel: [ 111.498452] Pid: 2530, comm: ifconfig Tainted: P O 3.8.0-rc1+ #1 Dell Inc. Latitude E5430 non-vPro/0D3M0X kernel: [ 111.498546] EIP: 0060:[] EFLAGS: 00010206 CPU: 2 kernel: [ 111.498605] EIP is at iwlagn_bss_info_changed+0x103/0x5a0 [iwldvm] kernel: [ 111.498661] EAX: 00000000 EBX: ea3edccc ECX: e75c66f8 EDX: 00000002 kernel: [ 111.498718] ESI: ea3ed2e0 EDI: e75c66f4 EBP: e757dd10 ESP: e757dcd0 kernel: [ 111.498775] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 kernel: [ 111.498825] CR0: 80050033 CR2: 00000000 CR3: 27523000 CR4: 001407f0 kernel: [ 111.498882] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 kernel: [ 111.498938] DR6: ffff0ff0 DR7: 00000400 kernel: [ 111.498975] Process ifconfig (pid: 2530, ti=e757c000 task=e7f1cc80 task.ti=e757c000) kernel: [ 111.499043] Stack: kernel: [ 111.499064] e757dcec c1079c88 00000000 f57f80c0 efd38cc0 f57f80c0 f57f80c0 00000000 kernel: [ 111.499160] 00000000 ea3ed304 ea3ed2e8 e75c66f8 e741f200 f921ca20 e75c6000 e741f0c0 kernel: [ 111.499254] e757dd44 f8aa379e 00004000 00000100 ea3eca68 ea3ec360 00000000 e75c66f8 kernel: [ 111.499348] Call Trace: kernel: [ 111.499379] [] ? ttwu_do_wakeup+0x28/0x110 kernel: [ 111.499433] [] ? iwlagn_mac_config+0x3c0/0x3c0 [iwldvm] kernel: [ 111.499506] [] ieee80211_bss_info_change_notify+0x9e/0x1b0 [mac80211] kernel: [ 111.499599] [] ieee80211_vif_use_channel+0x29c/0x490 [mac80211] kernel: [ 111.499682] [] ieee80211_add_virtual_monitor.part.16+0x1c0/0x340 [mac80211] kernel: [ 111.499760] [] ? led_set_brightness+0x45/0x50 kernel: [ 111.499825] [] ieee80211_do_open+0x80a/0xae0 [mac80211] kernel: [ 111.499885] [] ? __raw_notifier_call_chain+0x1e/0x30 kernel: [ 111.499953] [] ? ieee80211_check_concurrent_iface+0x20/0x1a0 [mac80211] kernel: [ 111.500038] [] ieee80211_open+0x5d/0x60 [mac80211] kernel: [ 111.500095] [] __dev_open+0x83/0xf0 kernel: [ 111.500141] [] ? _raw_spin_unlock_bh+0x16/0x20 kernel: [ 111.502636] [] ? dev_set_rx_mode+0x2e/0x40 kernel: [ 111.505137] [] __dev_change_flags+0x81/0x160 kernel: [ 111.507634] [] dev_change_flags+0x21/0x60 kernel: [ 111.510145] [] devinet_ioctl+0x539/0x680 kernel: [ 111.512652] [] ? copy_to_user+0x41/0x60 kernel: [ 111.515143] [] inet_ioctl+0x8d/0xb0 kernel: [ 111.517624] [] sock_ioctl+0x69/0x270 kernel: [ 111.520096] [] ? sock_fasync+0x90/0x90 kernel: [ 111.522557] [] do_vfs_ioctl+0x7a/0x5a0 kernel: [ 111.525017] [] ? __do_page_fault+0x267/0x4b0 kernel: [ 111.527474] [] ? final_putname+0x1d/0x40 kernel: [ 111.529931] [] ? putname+0x24/0x40 kernel: [ 111.532379] [] ? do_sys_open+0x155/0x1b0 kernel: [ 111.534777] [] sys_ioctl+0x6b/0x80 kernel: [ 111.537136] [] sysenter_do_call+0x12/0x28 kernel: [ 111.539471] Code: 00 01 0f 84 b8 00 00 00 8b 43 72 8b 4d ec 83 c8 08 89 43 72 80 79 0a 00 0f 85 b8 00 00 00 25 ff ff ff bf 89 43 72 8b 4d ec 8b 01 <8b> 10 89 53 5a 0f b7 40 04 66 89 43 5e 8b 07 89 c2 83 e2 fd 83 kernel: [ 111.544677] EIP: [] iwlagn_bss_info_changed+0x103/0x5a0 [iwldvm] SS:ESP 0068:e757dcd0 kernel: [ 111.547166] CR2: 0000000000000000 kernel: [ 111.564957] ---[ end trace a972af45bf5c52e9 ]--- : Kernel logging (proc) stopped. --- drivers/net/wireless/iwlwifi/dvm/rxon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) iwlagn_bss_info_changed(struct ieee80211_hw *hw, /* Enable RX differential gain and sensitivity calibrations */ iwlagn_chain_noise_reset(priv); priv->start_calib = 1; + memcpy(ctx->staging.bssid_addr, bss_conf->bssid, ETH_ALEN); } if (changes & BSS_CHANGED_IBSS) { -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/iwlwifi/dvm/rxon.c b/drivers/net/wireless/iwlwifi/dvm/rxon.c index 9fabd26..b173497 100644 --- a/drivers/net/wireless/iwlwifi/dvm/rxon.c +++ b/drivers/net/wireless/iwlwifi/dvm/rxon.c @@ -1490,7 +1490,6 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw, else ctx->staging.flags &= ~RXON_FLG_SELF_CTS_EN; - memcpy(ctx->staging.bssid_addr, bss_conf->bssid, ETH_ALEN); if (vif->type == NL80211_IFTYPE_AP || vif->type == NL80211_IFTYPE_ADHOC) { @@ -1534,6 +1533,7 @@ void