Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp976861ybt; Fri, 19 Jun 2020 20:16:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyu9z6fv0AG+ZnYoXR406wPc8Z1etYOLClgQHDiO1rFXeZrwGbGNLCYWTNWRe9u85Rv4hAw X-Received: by 2002:a17:906:aac8:: with SMTP id kt8mr6589920ejb.460.1592623013621; Fri, 19 Jun 2020 20:16:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592623013; cv=none; d=google.com; s=arc-20160816; b=p5KwG/7ctABVGx6kmgvzSeRvBjiB957VLimQr/8mbOPsPA5gtL3VsoAr9jBmBGrZql RsGPJ9Zm4F+b30jNhNBBGbK8ugg0PjoOKLA7095uci+tLiUONXn2ps7Xxxd6A/WsLecv fDUJPLO3C+cpRZijhj02F2eCVKUkXRivH2+0U6RzXLy/pq0RlkOihlmWuY1oyJWbO2jB OHETj9TFEXnFFeg5lbUlXUTnjmB3T8fngFlzvJmR/b7fN1oBq371ZD6/z0ClCCm+m2OG 9HsV22nr9+G4FJY2c79RXKXSajUq4LN1uLWYRHcw0d1O/3bkK9+EdiaFJuoUpME8zYga QvWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ppVChNn+zIehRId5iMKHdK8ujae8kimG6cNU00ZouZQ=; b=n/zXbNaqyNTjt+qvVBsG1PT/HWhuBWjGIaIjaGeJoiQ1uQ9/wW0lBm5yAFz0MDjOQQ NHCVfz70uA/x9+FR94O1UmSRTggzBZI8hZUKKvsK+8PQO8f+EuNXaeEatHMbAyvzfv2r JBRkVKg2Py/NTiXLiLytNDPz8fzFkS0B1zCAm3advz5QXjNa6nuowvsMimzNXlBPSBMm ZPYqqUI/QFeGxfCan3gbZ2lhO4ogrA6t3DMeIvtds7iU66G5O2rTNB/0vi43UnuP0Tc9 GC+QBQDTg/jtbz0y9myWfc0AOOrqEHEtKxQqqxXHgym2fdNZGmzT/WHRnHLEqQzfFlBq 455g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aYRsr6y8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si4519319ejc.447.2020.06.19.20.16.25; Fri, 19 Jun 2020 20:16:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aYRsr6y8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392531AbgFSPz2 (ORCPT + 99 others); Fri, 19 Jun 2020 11:55:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:52704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392848AbgFSPV0 (ORCPT ); Fri, 19 Jun 2020 11:21:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 97D1321582; Fri, 19 Jun 2020 15:21:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580085; bh=UgH8czb3Zqf99cuf6/cq5xSM1xd308oDJ5vXdkILL9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aYRsr6y89jsF1oA/X3Utv4ut4L6wOdTn3dkejmbI7cOlH1+q/oLwzfdDtzSZEdEB9 H33UiqN/WiVsd1MWm8lMUWmNGYJlSMDmQ2tAWiaBx3J8009FwPV7ke1Ry1un0lXjng 9ufEw5hmfusDQIqeuF6cO9Ui4GoG+D72DC9g4fkU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Venkateswara Naralasetty , Kalle Valo , Sasha Levin Subject: [PATCH 5.7 086/376] ath10k: fix kernel null pointer dereference Date: Fri, 19 Jun 2020 16:30:04 +0200 Message-Id: <20200619141714.414954120@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Venkateswara Naralasetty [ Upstream commit acb31476adc9ff271140cdd4d3c707ff0c97f5a4 ] Currently sta airtime is updated without any lock in case of host based airtime calculation. Which may result in accessing the invalid sta pointer in case of continuous station connect/disconnect. This patch fix the kernel null pointer dereference by updating the station airtime with proper RCU lock in case of host based airtime calculation. Proceeding with the analysis of "ARM Kernel Panic". The APSS crash happened due to OOPS on CPU 0. Crash Signature : Unable to handle kernel NULL pointer dereference at virtual address 00000300 During the crash, PC points to "ieee80211_sta_register_airtime+0x1c/0x448 [mac80211]" LR points to "ath10k_txrx_tx_unref+0x17c/0x364 [ath10k_core]". The Backtrace obtained is as follows: [] (ieee80211_sta_register_airtime [mac80211]) from [] (ath10k_txrx_tx_unref+0x17c/0x364 [ath10k_core]) [] (ath10k_txrx_tx_unref [ath10k_core]) from [] (ath10k_htt_txrx_compl_task+0xa50/0xfc0 [ath10k_core]) [] (ath10k_htt_txrx_compl_task [ath10k_core]) from [] (ath10k_pci_napi_poll+0x50/0xf8 [ath10k_pci]) [] (ath10k_pci_napi_poll [ath10k_pci]) from [] (net_rx_action+0xac/0x160) [] (net_rx_action) from [] (__do_softirq+0x104/0x294) [] (__do_softirq) from [] (run_ksoftirqd+0x30/0x90) [] (run_ksoftirqd) from [] (smpboot_thread_fn+0x25c/0x274) [] (smpboot_thread_fn) from [] (kthread+0xd8/0xec) Tested HW: QCA9888 Tested FW: 10.4-3.10-00047 Signed-off-by: Venkateswara Naralasetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1585736290-17661-1-git-send-email-vnaralas@codeaurora.org Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/txrx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index 39abf8b12903..f46b9083bbf1 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -84,9 +84,11 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, wake_up(&htt->empty_tx_wq); spin_unlock_bh(&htt->tx_lock); + rcu_read_lock(); if (txq && txq->sta && skb_cb->airtime_est) ieee80211_sta_register_airtime(txq->sta, txq->tid, skb_cb->airtime_est, 0); + rcu_read_unlock(); if (ar->bus_param.dev_type != ATH10K_DEV_TYPE_HL) dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); -- 2.25.1