From patchwork Mon Oct 24 11:28:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9686 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp537532wru; Mon, 24 Oct 2022 09:17:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4T/zHnc3hbqdWd5gwUgdtcdvClhevkcQpjyAg4FXC6ZLR/0qS2SXqXfllNB9m0dGlGbV/1 X-Received: by 2002:a05:6402:5510:b0:459:5ea:9bc0 with SMTP id fi16-20020a056402551000b0045905ea9bc0mr30932185edb.152.1666628220090; Mon, 24 Oct 2022 09:17:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666628220; cv=none; d=google.com; s=arc-20160816; b=Ov6yOzR3yMKZjXCmuNKckWQlU3TN2cB+IAoyfA9y40nJbh1HVaaKxrlnfSOC1Tbaqf Q86ofJkXUWShCgeVWIUiWBZD5zTztMB14uwJb/FEj7ufj91O+55g/XRZG2T9rLZ2waN5 pNTZeG34hMxMNVyuedyGMMOf8b6ujmuVSehZSE521VaFRHBWYpdLhpr1AGeKcyYNeq9g Rz8lWg0YS/zX2/POceAkBLPawaVo96kEXplpsyUPVchAk+niYIUrk4gF8JlXDPYK82Mz tjIi9Kho72xm3Kh6BKHtIHAsXcRL5BBDb6mGI5UJ7oU6R2Yn3aaoJtPdvAyntax/yt9O nc5Q== 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=IfVhXNuKdzImEfPGJY2KehPMcTY7kHTa0LvhLZK0rCA=; b=Kx2ZKVpkK1nTh+ThsiEEeipfAjNpJrfkZlAZwiNxr6fgo+OzTpv3rVkCFGL2V+Ls9I Mq0oIP6311RqJPYGzHtYn0EiAgg4G+SxP4VaHv8s5WcyPQieizqzUCUrEebKJQsE7zEH wz3k9gASGOHv8XZAlA+gz5JM6j8Z5KFllxjvrRxnPo3W5T9Dl04aVCJ+rNsSXwCvkT5B 7dI48YNqtRmtkc/cUh6zidOu8uGlyAaSKN3L8Mw/YVCWmg1M2H0k2Lxa56gn9VaN8Aia Oey+4FPda89aM2ds4JcGUuXIHrsxLlC/Ii192dPWBU7Wp/ACJnF0bnP77eHMT42vkLmJ 1DxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CDcR1cIY; 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 qo14-20020a170907874e00b0078dc5c888f1si237574ejc.135.2022.10.24.09.16.36; Mon, 24 Oct 2022 09:17:00 -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=CDcR1cIY; 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 S233689AbiJXQNZ (ORCPT + 99 others); Mon, 24 Oct 2022 12:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234803AbiJXQKZ (ORCPT ); Mon, 24 Oct 2022 12:10:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 044C416F40B; Mon, 24 Oct 2022 08:01:25 -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 2F73AB81637; Mon, 24 Oct 2022 12:22:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83C97C433C1; Mon, 24 Oct 2022 12:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614155; bh=pUGT69ifJ5OVidgnRzAuPxhCCoewVWUlq0pJhRaVMMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CDcR1cIYnboUtXB9Mbar58OXagDf3Cl8O8hFg+errX8vIa5bJB4YpmS7AeQOoqzWU WP1Z6h/hPvdQk+pLwkjSlipiYzpRL7TFeIl/z0P1+0+0nyXSBP7733vOhRVZonE6Ql 6lm94L5lHc/7efOuADPkJIrWoKSM2OuOIYW1XuQM= 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.10 113/390] wifi: rtl8xxxu: Fix skb misuse in TX queue selection Date: Mon, 24 Oct 2022 13:28:30 +0200 Message-Id: <20221024113027.513208767@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747586352475745812?= X-GMAIL-MSGID: =?utf-8?q?1747586352475745812?= 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 9f646964055d..e8b4544b5b15 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -4984,6 +4984,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); @@ -4996,7 +4998,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) {