From patchwork Mon Oct 24 11:29:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8768 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp430434wru; Mon, 24 Oct 2022 05:41:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6shHQrPOPIwmaYqzUyqSSZXIEKmLY6+w3C49ZDmZfQuiMzpS7SPDKzQYVwg98A2B4zQG0T X-Received: by 2002:a17:903:509:b0:179:ffcf:d275 with SMTP id jn9-20020a170903050900b00179ffcfd275mr33334573plb.150.1666615292071; Mon, 24 Oct 2022 05:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615292; cv=none; d=google.com; s=arc-20160816; b=VKSdAQ+WpiEkM18OgHIPo/6Eu/aDg9SG5grU4INiJaVu/jcurVcFFz8n5id4ZCRWI7 KZPsEmbIcB+B0WU5eu7XLJK7ks/XkShViVQohEpblwp6d9DjZ72CKW7qK8Pm9YmlGitW Sxq1Q+yGHYA8yom7nzs+SgnwLxrK7sOWB0sEF4fN/EmPhKvxIS04ta2FRHPykTlhYkRZ fRPUuEk70QE/qAlzdkYA5DWPVimz3Boa3J654qCG6uxGg4dxulQS8HSssT0vv+ZqTPve 8b6o0v8Z2d2PVuRgMYVeQNJAtoX1MAs1dn37T01rkiwFCsyT2BO3CE2HBhcag4B+n4sm LpWA== 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=HGiYgE9Q4NvFlOnIQDgo8kc9zDmr6VUfKUUtUod5tts=; b=kobJxMBzlnSiz3yVyi9ZkSvXpzd8N2Fo4a7EawMBG4pHo5db8isG3geiTYGOfuyjUy U78Ve/CBl3/rd48XcnS5+4RKB1XnHKvxjttdPqzdECtJumdS0ZvP5xcrGmcezGQg28g8 XLYC2eFm3tOX+8+KDvRnlUKcvuNQ/K/lmWFbUc8N1RaWs2d9QOgH/8fBW507wP2oHUUG ORkg8yg0Tk0mpI4oH2V+Wt82KW55S2F6uLQ9newzOcCR4pduCd3Yvbd6C8joUNmhycPk aHG5d0wuMxy2pwsfiaAf7RwhBxkBQvBKbFMUWPd42SvIpXOvbkWzavtvSmkqYsr5FxEd y6XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g6O01pwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f62-20020a623841000000b0056bf15d0cbfsi1687571pfa.308.2022.10.24.05.41.19; Mon, 24 Oct 2022 05:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g6O01pwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233781AbiJXMas (ORCPT + 99 others); Mon, 24 Oct 2022 08:30:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233853AbiJXM20 (ORCPT ); Mon, 24 Oct 2022 08:28:26 -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 3304F84E49; Mon, 24 Oct 2022 05:02:07 -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 2A81AB811EC; Mon, 24 Oct 2022 11:58:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76EF2C433D6; Mon, 24 Oct 2022 11:57:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612679; bh=uFYB0cMrlpLGVch5KrvwzaqTPsuapCqPShLgRKBJC3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g6O01pwLlDLiFgkcFQ9R+Sg8R2HCKZhk7yvJgH/93f0pLEMosLGBsHlopUqXL+6IN iJqdTu0YXeQZBmYPv3Lohx/FPWBQdEzP93+uUj+SpXPk5hxu3clBddJ+GtrWEzqkn0 6L8CyS8497GXiRtr/G8QlOhb2tgJiaVfPwfmfQFU= 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 4.19 078/229] wifi: rtl8xxxu: Fix skb misuse in TX queue selection Date: Mon, 24 Oct 2022 13:29:57 +0200 Message-Id: <20221024113001.589827008@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747572796480898185?= X-GMAIL-MSGID: =?utf-8?q?1747572796480898185?= 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/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index dd345ed1a717..ccd76c1da40c 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -4955,6 +4955,8 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw, if (control && control->sta) sta = control->sta; + queue = rtl8xxxu_queue_select(hw, skb); + tx_desc = skb_push(skb, tx_desc_size); memset(tx_desc, 0, tx_desc_size); @@ -4967,7 +4969,6 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw, is_broadcast_ether_addr(ieee80211_get_DA(hdr))) tx_desc->txdw0 |= TXDESC_BROADMULTICAST; - queue = rtl8xxxu_queue_select(hw, skb); tx_desc->txdw1 = cpu_to_le32(queue << TXDESC_QUEUE_SHIFT); if (tx_info->control.hw_key) {