Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6809958rwi; Mon, 24 Oct 2022 06:26:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4CotpJn57WvIO+TqfhKF+byk+cu7wBqhR5S2bU4Gz3IJCMC6wMJDchRu9Zl2YMYIIj5hRA X-Received: by 2002:a17:906:cc48:b0:7a8:4a3b:11f7 with SMTP id mm8-20020a170906cc4800b007a84a3b11f7mr4177169ejb.388.1666618005040; Mon, 24 Oct 2022 06:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618005; cv=none; d=google.com; s=arc-20160816; b=P1dAevZthozZpov+qWvu/St6npzWojX8rP+XiFOX5pt2XmzLSnhZ7GAPes/5mJqA1r tCw1u2qj8l8x3SKlmyU37L7A49QDIvnmq1wM2Sil0qQJV0ScYIKQadAO6alF09+iUoeb KnnHpmfqJ8E/sWRfip4wvQx87LEWIa7qf2LrQvHCIaxWqipAohtfGuSwP9cvYKkInvHk qmIO4xxNJUFVlPVZRVuhibVvtJqePbZkM/qWIFh0t9yH3+M/ooxLdMKonXvGITlQSlIQ ATYf38YNc1oIlMyq3NkGcf7HOesvcL60E74SfGTzLvQt9m9g0LymZx7oQ7nAP1ySxnvz JIUw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ee34-20020a056402292200b00457263f9ee0si9688435edb.93.2022.10.24.06.26.19; Mon, 24 Oct 2022 06:26: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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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) { -- 2.35.1