Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9118553pxu; Mon, 28 Dec 2020 07:06:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLdml1vvge9JnkFv21tiaO00MJmsRB7BqLXBc2g4Vn/t81r5ACr2sPZtwPdPicfKasa2Mx X-Received: by 2002:a05:6402:31b5:: with SMTP id dj21mr43492965edb.90.1609167973040; Mon, 28 Dec 2020 07:06:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167973; cv=none; d=google.com; s=arc-20160816; b=TLLz3yYDPxInmmO+sgmT09Pl97E0usVy6edC3rlLZ1Tpoy7j1/3TTB7QD4Y5XukNeI DTtj5MNXIWM00LvX6uwFE+zQ637+3PMiyJdR+R/BhBcMObmFU2SI3rplaQrp+fsxpD3m L1YXPvKYvyW6kv2BCJyWlzpZBFut96gxjiplbd8ZUZfXrLwRh9R7Itp/GpNdoBNMW0Ne KzN4hR9V6Q0Wp1oBv4xa2Sx/2k2vKE0J78CcEi+tigZeS638luw7ngXsvI66Z5/R3ean 1xvIHIcwrzhYh0LQfialYiz6+0c0gLt5+2E1qdoGEOtONcqRNUCMF5If5HbZ1vjJOOv7 2DYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PgNidrSTzTX9D/UXkJwbYsdEM0KWiuXAFwf3B4GPDM4=; b=QG46D9jtsUzr3C62XZypbPeq9DksTFTNB/iMHqu++y7DQQUp0BCEpXw3sO6rslPe18 hmSfgRWHEm7LI87/GI3l1LGID12KCBBAqJ4i7JRgHzXeOMmI9nN3V2kLYf3Rzfc/Dwfj CC4U1ZNyB1w35RZZ+8lKYEh1hi4GllDFRNzvkvNPiGeNWgT0iw3CRurivhJ9x20h9bHN +GhJZEWY8avkF1lHjCn2+Kis8oVso3Xoht+dASRGicapRRCQh6PpqI1qCoTdiH6vEbPn nWhOxpUS/vnm2YuTyRiJLUiwNIwGDDQyXRNByHIBGrI8Zmlw9Gc5tSP0kqQA7DCTP6cb lzLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eiN+Dr8k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si12300757eji.387.2020.12.28.07.05.50; Mon, 28 Dec 2020 07:06:13 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=eiN+Dr8k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439792AbgL1OMH (ORCPT + 99 others); Mon, 28 Dec 2020 09:12:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:46706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439782AbgL1OMG (ORCPT ); Mon, 28 Dec 2020 09:12:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D83C7206E5; Mon, 28 Dec 2020 14:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164685; bh=6eGZIhwszPDKtwNIuHo1dw9GczcQwikWsynXpGVXpDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eiN+Dr8kXjYHby62ibo2u3O7qXiQRpCOb4f7t66k2+gMolIE2apdPi3YrKj6z7XIh 7VrLtPMk1xDL79+O9kIANWm0yeqcM9H3Q41mKNkvUz34BoAnYBuvmDgMqJlLuVLw+G YU8m7nOQwKtWp4VWm2ehECAR2JyzMDblsQdbYYEg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sven Eckelmann , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 261/717] ath11k: Reset ath11k_skb_cb before setting new flags Date: Mon, 28 Dec 2020 13:44:19 +0100 Message-Id: <20201228125033.504498972@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sven Eckelmann [ Upstream commit 5da7acfec5ec55aa0b69b8760f1d2116b4e2ad26 ] It was observed that the codepath for the ATH11K_SKB_HW_80211_ENCAP was used even when the IEEE80211_TX_CTRL_HW_80211_ENCAP was not enabled for a an skbuff. This became even more prominent when the QCAs wlan-open patchset for ath11k [1] was applied and a sane looking fix just caused crashes when injecting frames via a monitor interface (for example with ratechecker): [ 86.963152] Unable to handle kernel NULL pointer dereference at virtual address 00000338 [ 86.963192] pgd = ffffffc0008f0000 [ 86.971034] [00000338] *pgd=0000000051706003, *pud=0000000051706003, *pmd=0000000051707003, *pte=00e800000b000707 [ 86.984292] Internal error: Oops: 96000006 [#1] PREEMPT SMP [...] [ 87.713339] [] ieee80211_tx_status_8023+0xf8/0x220 [mac80211] [ 87.715654] [] ath11k_dp_tx_completion_handler+0x42c/0xa10 [ath11k] [ 87.722924] [] ath11k_dp_service_srng+0x70/0x3c8 [ath11k] [ 87.730831] [] 0xffffffbffca03460 [ 87.737599] [] net_rx_action+0xf8/0x288 [ 87.742462] [] __do_softirq+0xfc/0x220 [ 87.748014] [] irq_exit+0x98/0xe8 [ 87.753396] [] __handle_domain_irq+0x90/0xb8 [ 87.757999] [] gic_handle_irq+0x6c/0xc8 [ 87.763899] Exception stack(0xffffffc00081bdc0 to 0xffffffc00081bef0) Problem is that the state of ath11k_skb_cb->flags must be considered unknown and could contain anything when it is not manually initialized. So it could also contain ATH11K_SKB_HW_80211_ENCAP. And this can result in the code to assume that the ath11k_skb_cb->vif is set - even when this is not always the case for non ATH11K_SKB_HW_80211_ENCAP transmissions. Tested-on: IPQ8074 hw2.0 WLAN.HK.2.4.0.1.r1-00026-QCAHKSWPL_SILICONZ-2 [1] https://source.codeaurora.org/quic/qsdk/oss/system/feeds/wlan-open/tree/mac80211/patches?h=NHSS.QSDK.11.4.r3 (162 patches at the moment which are often not upstreamed but essential to get ath11k working) Fixes: e7f33e0c52c0 ("ath11k: add tx hw 802.11 encapsulation offloading support") Signed-off-by: Sven Eckelmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20201119154235.263250-2-sven@narfation.org Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 6b7f00e0086f5..af427d9051a07 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -4057,6 +4057,7 @@ static void ath11k_mac_op_tx(struct ieee80211_hw *hw, bool is_prb_rsp; int ret; + memset(skb_cb, 0, sizeof(*skb_cb)); skb_cb->vif = vif; if (key) { -- 2.27.0