From patchwork Mon Oct 24 11:30:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8588 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp419226wru; Mon, 24 Oct 2022 05:15:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5zGP1OfeqdmxuRmc+zTR0Y4uFoO2PGvZ1OrHYKNsdMB2UzpdoxBB02pnP/IiQXanL8lG/n X-Received: by 2002:a17:907:16a6:b0:78e:f140:a9b9 with SMTP id hc38-20020a17090716a600b0078ef140a9b9mr27319395ejc.502.1666613745303; Mon, 24 Oct 2022 05:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613745; cv=none; d=google.com; s=arc-20160816; b=F2LpuGuYFEbSIq1YIC6tsHlcfcyKbIDrG2qnJAh+cJhBJp8hFMRFkD3JmLEP5vZW9Q Ed8m3F19141hgFcG73IMP1WLA44/dHuRhyr882c3k1rkLcbglYOJT5SVDm5iXMjtUPlp MUxF/1lm2zOjXoVKG1Nvn3scKF9AWpgCGRmJSVQnhhRryn9/QikzJiV7d1DBE3Li8JEZ 8vRcnPiqFau9i4jVmqfj5J977B+IhnNWssjwM+xWwN8PdXB1O3232IBwBAPIAN338qGv I7bAzyIOmCOp4YS5m9FLiSGjrnmIFebgH5pRnIMVgdWdmBVxV4C53h5x7fuA3ovi7b6u WzTQ== 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=OqZXpU/JNNzmO8lPLoQt2ycvpqHHnrInzjjfk3MvQ80=; b=zt6TS6bSNhPOGO2rgreSEsMnDhkilfyYFRqNM+6d8mOtA6POruur6JQUGrm2rlj2P6 dzLULroR7UUhWQsrH2W0xy5E/ollisXiwpwpylkCm/zB055cMi43QwmEAE7SzCvG+jUp 2dFHjbhcHZAQGHtjewn+Ud6C0Wjhq+Lp21mCfFb1bCfJe6923HvOiq4jZd7nnn03tSIW PAipZnJ5zigRrnoLjioXE3CfDi72PVk7nTNTWPPewXuKZIqeBsEQMcu4W2uYXcLnmN2y /88S0SJXwWtM2YxBqogpnMN5GsU1wCx7IaKXi3T8ho7Yd2TPFfEYvTQ66hbIupmc1r52 UZ/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ES5RJg1Q; 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 qa43-20020a17090786ab00b00782b261ea1asi27258230ejc.67.2022.10.24.05.15.21; Mon, 24 Oct 2022 05:15:45 -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=ES5RJg1Q; 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 S229544AbiJXMGW (ORCPT + 99 others); Mon, 24 Oct 2022 08:06:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232761AbiJXMEO (ORCPT ); Mon, 24 Oct 2022 08:04:14 -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 01BE9638EB; Mon, 24 Oct 2022 04:50:30 -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 71FBEB811B6; Mon, 24 Oct 2022 11:49:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96ACAC433D6; Mon, 24 Oct 2022 11:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612147; bh=nLPJMf6RKNv0U3Go0wd8wDoSsDzpMir4BM5wySpxLXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ES5RJg1QJpie1U1TPWrNyrzqP09RGfdL4xaLTnPWH/LB4Ti93EOdsAgZKzqU7hQpY KC91oYX4xHvkdLrFvkuUFmA5dato9qBUJE9e5ckJIHalhrPyVA8SQfbbs6vPQR0EXH yKf7E5RSNpWG2VMoFqnYWw7OVD0rR4a4Uuz69C00= 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.14 087/210] wifi: rtl8xxxu: Fix skb misuse in TX queue selection Date: Mon, 24 Oct 2022 13:30:04 +0200 Message-Id: <20221024112959.871050235@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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?1747571174738689918?= X-GMAIL-MSGID: =?utf-8?q?1747571174738689918?= 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 5588518daa96..7cace68ef3c7 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) {