From patchwork Tue Nov 19 20:52:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 3203981 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3CA42C0C5E for ; Tue, 19 Nov 2013 20:52:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78D2E201E4 for ; Tue, 19 Nov 2013 20:52:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7EFD62052C for ; Tue, 19 Nov 2013 20:52:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752705Ab3KSUw1 (ORCPT ); Tue, 19 Nov 2013 15:52:27 -0500 Received: from mail-wi0-f170.google.com ([209.85.212.170]:33209 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752309Ab3KSUwX (ORCPT ); Tue, 19 Nov 2013 15:52:23 -0500 Received: by mail-wi0-f170.google.com with SMTP id f4so7199566wiw.3 for ; Tue, 19 Nov 2013 12:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HPOqpkVDrpow4tMQD4QGk6S14CUrp/1l+4kndW67XK4=; b=P6JcJZ7uBwE2k5B3jm4licr3SmvJKZN9erZ3Qnm6fCaXre/cgs7y1ewlenysMINV/T kHEST+m0bLUVIvF1v2npGhkFFGLWyXGPZkCTUsK0ucA8L/RRU9SFeJXYDItNmW+DC1Wz axsDCY3/vyOgdLPAwq7K6nlSO+padU1IaslIaP91I4NB2tQjNW/DcvzGJhrjHJcjvUs5 6MAe4aUQHaxW28ajmfQioKp3fWXPdXbt9kzLcSKRxX/hISOn85Aw/l4GXt5a2HCOoTtc Ik4OCk9jBlTkDkY3txCYfupuMbbHYZy97gl8surAfU9T9GG5cyK2CrtWXh91XGmEWJ7M 3+QA== X-Received: by 10.181.5.40 with SMTP id cj8mr22373162wid.18.1384894342594; Tue, 19 Nov 2013 12:52:22 -0800 (PST) Received: from localhost.localdomain (93-173-143-36.bb.netvision.net.il. [93.173.143.36]) by mx.google.com with ESMTPSA id je17sm9236772wic.4.2013.11.19.12.52.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 12:52:22 -0800 (PST) From: Emmanuel Grumbach To: linux-wireless@vger.kernel.org Cc: Emmanuel Grumbach Subject: [PATCH 5/7] iwlwifi: mvm: BT Coex fix another NULL pointer dereference Date: Tue, 19 Nov 2013 22:52:04 +0200 Message-Id: <1384894326-24676-5-git-send-email-egrumbach@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <528BCEDB.8010703@gmail.com> References: <528BCEDB.8010703@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Emmanuel Grumbach This patch is very similar to a previous fix: 22cba0c0852f When we disassociate, mac80211 removes the station and then, it sets the bss it unsets the assoc bool in bss_info. Since the firwmware wants it the opposite (first set the MAC context as unassoc, and only then, remove the STA of the API), we have a small period of time in which the STA in firmware doesn't have a valid ieee80211_sta pointer. During that time, iwl_mvm_vif->ap_sta_id, is still set to the STA in firmware that represent the AP. Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/bt-coex.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c index b647147..75b72a9 100644 --- a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c +++ b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c @@ -841,6 +841,11 @@ static void iwl_mvm_bt_rssi_iterator(void *_data, u8 *mac, sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], lockdep_is_held(&mvm->mutex)); + + /* This can happen if the station has been removed right now */ + if (IS_ERR_OR_NULL(sta)) + return; + mvmsta = (void *)sta->drv_priv; data->num_bss_ifaces++;