From patchwork Sat Oct 22 07:21:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7345 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1095113wrr; Sat, 22 Oct 2022 01:01:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7gHjkx6BvigRm5VAfsEkaQzx49KzyqhM7u7LNvzud5aPoKUwqWDwp7JIwiCtftTG6v8dPZ X-Received: by 2002:a17:90a:7787:b0:20d:3093:ae7f with SMTP id v7-20020a17090a778700b0020d3093ae7fmr59959665pjk.226.1666425710372; Sat, 22 Oct 2022 01:01:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425710; cv=none; d=google.com; s=arc-20160816; b=dgUBB5uFIrQm3kfFwaXIPCUQUQel3Md1AR/yhUfJ+wLHs7THdNZt9x/Ya4L+B4yrRb 4y80/gsH5eb2Yc5U9v5KucOEY1LGWkhsv2QqK1Bc90/dFkqAT90O4wDzDWyw4+R/Men2 NfnFCw6i/RxptfDuA5CML3dJYjL475clS8y1F5uZ9/j5Nv7OA56VFZgex0DWfxVGlKWn TXYhGjykJ1VE3jOqI6A7nrhQPwfk6JKjKD6adhquHriPxecheChvDS0MLdv9J3Yaf7yN exv+vFD62bwRkjOYXcEGr1hlmo8EL9Se6mLmPIb+jfpI9/fWw4dQNVl3bLsbL26aCok1 IwvQ== 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=zPkFgHAVcaSeD+A6B+xQ+vbMRTAPNqXsyabSOTiCVwU=; b=s4dCgJ4XSwF3GNWMHcaSQZwmgkocR7jQOu9YxqRyqgxQ27T/e2i2Sx7nhGoLnwPXxj UenavUVxfbHYmtJbsjPwe7m8GyFRkgpTfrIMuFUrjo/R7EX5SGuCqD+ZbnH1gQgyBMjX X0YvaQvkl6woD9KnrgY8JyJT/3jabf+1MZOwNV6nLcWsIv8d8z7+IAjds9IWTimHe0fh I1ki/nOD3ElxVXQBZHPiN4AFi0Vn4JeIRn+3Jnfz2IDDPDB/E95k1i2WUx9BVx8zXujn 6ee397VeqBm3F8rgLALf/aQBfpEWkpyJMI2Ytag6Nv3GjqLN9ScgWONyWLyKSiQRJFQd jIQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IfbprFsI; 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 n3-20020a6546c3000000b0046edc0aea7csi1201809pgr.515.2022.10.22.01.01.08; Sat, 22 Oct 2022 01:01:50 -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=IfbprFsI; 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 S232148AbiJVIAs (ORCPT + 99 others); Sat, 22 Oct 2022 04:00:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232173AbiJVHyS (ORCPT ); Sat, 22 Oct 2022 03:54:18 -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 C32845A3EA; Sat, 22 Oct 2022 00:46:50 -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 80266B82E2D; Sat, 22 Oct 2022 07:45:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6FD1C433D6; Sat, 22 Oct 2022 07:45:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424748; bh=Ogzw9qM8KkQVpHjdhIA1KvCs1Ygr9naTGEPaYfLZdPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IfbprFsIfZRsp78WkSlEvFkv4xSAq6ohIn7aTkHpBvdazsES2rkOZyT2kmoHlO9fo 0MQ9ly6oRosYzpPn7UB61nIXxo7IwmA9iW14QAvl9jpv7uBamhzEqj/KSLPUNxUUiO SUJdEzkXGZ0BC7U9gHG/ggSF2UyvwF8iURXWag/g= 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.19 232/717] wifi: rtl8xxxu: Fix skb misuse in TX queue selection Date: Sat, 22 Oct 2022 09:21:51 +0200 Message-Id: <20221022072456.114362939@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747374005732826928?= X-GMAIL-MSGID: =?utf-8?q?1747374005732826928?= 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 7f09359a238f..03b04d6913d7 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) {