From patchwork Wed Oct 19 08:25:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp223779wrs; Wed, 19 Oct 2022 02:38:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5QJ00y5ZJ77K7an3eWzSu7CYTGCTgAJk1hufW3oi/JgXQzXncZJvO6MKMj6+kEt1HYCkQY X-Received: by 2002:a17:907:2cd9:b0:78d:9f4c:9cff with SMTP id hg25-20020a1709072cd900b0078d9f4c9cffmr5955522ejc.345.1666172307807; Wed, 19 Oct 2022 02:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172307; cv=none; d=google.com; s=arc-20160816; b=bEClZWF0dCsmxleCHUsIhxGA06BD48KDfQiMYiM1kHFlF7PEzQI1km+uAcd23akEHu m3X1eBVAiRw2HbcHNzBOJHWsAhlFDtZt9/KhnU7Q8zPqJlZnsujNTl7VJqr5GZTDAxGP f6xqNbUOZ6IyG29JwH9gUqsZHQ7NGwQ8xwk5CYEgVKBVMx7IqAsEMNipmX+UMo4EsUzD umOivTaQ9OOKsuJozfTRaYHzzM0FYAtQmShaWSwvdzNKI6s7yJCCBg3UhXmBUrpR/u38 P1X5h39hkij+TEtJ64p3dVTofUEwerw2MwUFzphx48d2QF/VXuBCIc51GdorICr7Pdl7 yIJA== 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=ovVoHIMD7T2RlEfGpZPy4MGyHY9NaSNYA/K2arQ2hXQ=; b=IcB9cEHvx/d0gdjXBMiV5UYQ8BGoJSull/Il33JOeG/p+C+ICCYws7Z54PFkKdDXp9 de+8IuG7J77G9odbB4ihpfJC03zNVgBBcz//zApGEK2Wd3DBtSOjhSRKN5grHsKW5Uxj sBcjv3IxW5q3GjemjOpsHZq/1E01rqKswjKT0oeFPOcAN+hlBbMEqWWqe2OdTnKJoB94 /sIbMjB15uv7vf89j+0qJV8EZUfLsccjl/sqzhLxe9AsC3YmUWVQqTzepm7cvwAUlxQe pPOjPRMDI8GeGr8dXM41dQOmsOqyoKQx7AaDRhMsUJgPt/rwRzP9WUP3mlcojPmFvtxP CSWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lpFqE09l; 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 b13-20020a056402350d00b0045d4015cdaesi12636149edd.372.2022.10.19.02.38.02; Wed, 19 Oct 2022 02:38:27 -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=lpFqE09l; 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 S233492AbiJSJ06 (ORCPT + 99 others); Wed, 19 Oct 2022 05:26:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233484AbiJSJZv (ORCPT ); Wed, 19 Oct 2022 05:25:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 513A0E4E4A; Wed, 19 Oct 2022 02:11:41 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5358061870; Wed, 19 Oct 2022 08:51:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B3AAC433C1; Wed, 19 Oct 2022 08:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169490; bh=pDLk8CPU5P/QEWRsVq3Z/u8/VfPTkx2Zmqh4kWzuxxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lpFqE09lmZcehYsn8myaubrMSy5dYWal83bvNAlN6aosDgHuUomBaG3l8261P9j3K 5p2NnH5bg5gGpYAPkiOy8PjYGcZrg7/bML19bZ13ap85nc1/5Yo0Hoky7z2RtL/uaP xwPkIGlmj79mVAz6vmMml5pttrxuCu3XAJsDoCQM= 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 6.0 269/862] wifi: rtl8xxxu: Fix skb misuse in TX queue selection Date: Wed, 19 Oct 2022 10:25:56 +0200 Message-Id: <20221019083301.905271087@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747108293536902578?= X-GMAIL-MSGID: =?utf-8?q?1747108293536902578?= 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 f3a107f19cf5..02b7bc57d217 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 = control->sta; + queue = rtl8xxxu_queue_select(hw, skb); + tx_desc = skb_push(skb, tx_desc_size); 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 |= TXDESC_BROADMULTICAST; - queue = rtl8xxxu_queue_select(hw, skb); tx_desc->txdw1 = cpu_to_le32(queue << TXDESC_QUEUE_SHIFT); if (tx_info->control.hw_key) {