From nobody Fri Dec 19 22:02:04 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E28BBC04A95 for ; Sat, 22 Oct 2022 08:00:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232157AbiJVIAt (ORCPT ); Sat, 22 Oct 2022 04:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232173AbiJVHyS (ORCPT ); Sat, 22 Oct 2022 03:54:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C32845A3EA; Sat, 22 Oct 2022 00:46:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 80266B82E2D; Sat, 22 Oct 2022 07:45:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6FD1C433D6; Sat, 22 Oct 2022 07:45:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424748; bh=Ogzw9qM8KkQVpHjdhIA1KvCs1Ygr9naTGEPaYfLZdPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IfbprFsIfZRsp78WkSlEvFkv4xSAq6ohIn7aTkHpBvdazsES2rkOZyT2kmoHlO9fo 0MQ9ly6oRosYzpPn7UB61nIXxo7IwmA9iW14QAvl9jpv7uBamhzEqj/KSLPUNxUUiO SUJdEzkXGZ0BC7U9gHG/ggSF2UyvwF8iURXWag/g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bitterblue Smith , Kalle Valo , Sasha Levin Subject: [PATCH 5.19 232/717] wifi: rtl8xxxu: Fix skb misuse in TX queue selection Date: Sat, 22 Oct 2022 09:21:51 +0200 Message-Id: <20221022072456.114362939@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Bitterblue Smith [ Upstream commit edd5747aa12ed61a5ecbfa58d3908623fddbf1e8 ] rtl8xxxu_queue_select() selects the wrong TX queues because it's reading memory from the wrong address. It expects to find ieee80211_hdr at skb->data, but that's not the case after skb_push(). Move the call to rtl8xxxu_queue_select() before the call to skb_push(). Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)") Signed-off-by: Bitterblue Smith Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/7fa4819a-4f20-b2af-b7a6-8ee01ac49295@gmail.= com Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/driver= s/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 7f09359a238f..03b04d6913d7 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -5062,6 +5062,8 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw, if (control && control->sta) sta =3D control->sta; =20 + queue =3D rtl8xxxu_queue_select(hw, skb); + tx_desc =3D skb_push(skb, tx_desc_size); =20 memset(tx_desc, 0, tx_desc_size); @@ -5074,7 +5076,6 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw, is_broadcast_ether_addr(ieee80211_get_DA(hdr))) tx_desc->txdw0 |=3D TXDESC_BROADMULTICAST; =20 - queue =3D rtl8xxxu_queue_select(hw, skb); tx_desc->txdw1 =3D cpu_to_le32(queue << TXDESC_QUEUE_SHIFT); =20 if (tx_info->control.hw_key) { --=20 2.35.1