Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp686418rwe; Wed, 31 Aug 2022 09:14:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR5dbg7gYEKKHusf8i1ZQgjquB+y7T+Eoqt+dw8aArkb3wtRx2TrtXly7djRrlCo1f0N2j2F X-Received: by 2002:a17:907:31c7:b0:740:e3e5:c025 with SMTP id xf7-20020a17090731c700b00740e3e5c025mr17139091ejb.341.1661962480384; Wed, 31 Aug 2022 09:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661962480; cv=none; d=google.com; s=arc-20160816; b=x6y10Z9oWGQsxot32DtQP84c9HMsxTONHDyOgDhRwrRs6e7qJ6no1eCm6eVYXW9jJR hTvxaDOptEdwqwy3I8NMlR8Ir/oej0UdCu/wavMUBLyMy47iBJDm1QhDZatb38d2eKJq SyCdy5Lj2FKe/RzMouzgZ2oaVqR+OYUgsy1BSRTdeHa01op8J8m6E4JQznj13Nveh9Yd 0j+E595bUOiWVVKXCH0SWVR0necgIxgcTsCK4pl6yUT0VlY1Q/wDmhn83DAKbxKx+zGx pB5TrAHXxRry1h/fp2j6GvSAxgoBMghqOj0G7RGYtjR2e/R9mrPjkSsWg6Emy2Ky4oN2 5pgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id :dkim-signature; bh=VxrF9E74uRVnPoXcdbe+5HFxEc3dhBDcblzIs6+f7Jc=; b=bED9sNHdBCT6oe25koqPFCjId+0028JUw5rVtWKbmI2mLurZ9kpgHIPuaAaC1m6Sv0 nJ+F4T/oFvbfsHBlYx9ZZSyovT71yUXRhiRw/L91GgzxzVATRdbWzLa6bLf3bt2diqte TctJX3l/fK8DzAQMLDppt1kZa92mmZyscL8B8ZzGLjKQasmbowIsy89dTG7GItlYur0K vgzjjb7Df8csqa2uR9RgUj4oI1MwvXPkZX1P/tqrJA5+RrsUkrNmrzhpYlxxVGcU1ugY gExnMB/5ttMN3I+nWR9ITcRae7mdGY5YiDVL0czj68BItyMuQkaWtZ+Kl7KTsXx9TEz4 CnRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TeknayFm; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a17090699c500b00741757d6293si8931619ejn.260.2022.08.31.09.14.20; Wed, 31 Aug 2022 09:14:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@gmail.com header.s=20210112 header.b=TeknayFm; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231360AbiHaQMl (ORCPT + 64 others); Wed, 31 Aug 2022 12:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231356AbiHaQMk (ORCPT ); Wed, 31 Aug 2022 12:12:40 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65252910B5 for ; Wed, 31 Aug 2022 09:12:39 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id gb36so8509554ejc.10 for ; Wed, 31 Aug 2022 09:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date; bh=VxrF9E74uRVnPoXcdbe+5HFxEc3dhBDcblzIs6+f7Jc=; b=TeknayFmbpmKTQJeDqPB407JNGoCrl7I/Q3B2umv6i3sFDElOZEj/OurWrW9D/tSF6 980MTFgRpSFV48E02AF0foqGXqu/Sy2gzhi4TGfdHIeJnq5lLkG0IB9H06y/rG6OmRmS M4KIFR6Wivp1joCbDirGdEsbva5cXwN25wQysrhtZ2BEaSO6JyUtZ8RUCtLs444mMtOj a4BwMDl5I79YbkYay128+5C90sF1kySAEJObRkyJz+/hYD0lgA5nOR5FGwZibsXcSe29 vnrvP6BhyTrcDB5oujfU1cbSBkhU01uqabO35eMTnWvuZ2f8DoW4xAK821xOjykb7z23 QKpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date; bh=VxrF9E74uRVnPoXcdbe+5HFxEc3dhBDcblzIs6+f7Jc=; b=TlfM4+dySvSD7ooRyFtb9MVV4khIHoUKXXCNMAeF7DYwUjMx34CUWogIKq7wPIHLUS PpVYuXsrSP9HbAJnAB3PTkIA5qVOn9KM17CM3ZrhiSPhslM+ko3G5Eb1Jr/9v4qFzB1G c+n/wOgEX0PZ6UIt3EkUdyKRGpiiO+wZ9APfMOByiLJ0l9L2dQKx6MQral+1g1wLX2RQ nxIHulpNNDJyJTHBVon9fO6Jwi0sH9wqHWRYinUghfbDJ17k9mHxL+8IZCm2UFOcUXMu 6hdz9heg5ePkZaYIquWOgqBmvmw1FIXGYxhg1eHHUNp1QnWMa+Stpb40QmVDqjGB+0Ja tfLg== X-Gm-Message-State: ACgBeo2Lm4VPl72hquwmxaFioUcRtjkLw+S+VRg4j8/Z+TlNMoJLqFoF WqrHzZyOinYbWk9l1O4/L3nlX8Q9pnHGNg== X-Received: by 2002:a17:907:272a:b0:741:855c:8875 with SMTP id d10-20020a170907272a00b00741855c8875mr10773731ejl.575.1661962357693; Wed, 31 Aug 2022 09:12:37 -0700 (PDT) Received: from [192.168.1.50] ([81.196.40.23]) by smtp.gmail.com with ESMTPSA id r5-20020a17090638c500b0073c0b87ba34sm7190326ejd.198.2022.08.31.09.12.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Aug 2022 09:12:37 -0700 (PDT) Message-ID: <7fa4819a-4f20-b2af-b7a6-8ee01ac49295@gmail.com> Date: Wed, 31 Aug 2022 19:12:36 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US To: linux-wireless@vger.kernel.org Cc: Jes.Sorensen@gmail.com From: Bitterblue Smith Subject: [PATCH v2] wifi: rtl8xxxu: Fix skb misuse in TX queue selection Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-wireless@vger.kernel.org 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 --- v2: Add Fixes tag. --- 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 52240e945b58..8d6f693bf60b 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -5177,6 +5177,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); @@ -5189,7 +5191,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.36.1