From patchwork Mon Oct 24 11:29:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10225 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp642882wru; Mon, 24 Oct 2022 13:39:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7S0H9mLY3JQ8MfBWGvIld4esOGoO/TD8Mlo59LMKnjZGsP5cBXn0zp4r7pe56tSkdvAQZi X-Received: by 2002:a17:90a:29e4:b0:20a:f9d5:c10e with SMTP id h91-20020a17090a29e400b0020af9d5c10emr77479687pjd.132.1666643992597; Mon, 24 Oct 2022 13:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643992; cv=none; d=google.com; s=arc-20160816; b=xwa+ReKMkouAp6PUa5uj+Z5C6jttg4vS2/QZRT1b92NMyu+jCKxRN9pNvLlmULOAu7 +zVnfNbcMUJo49ByLGt6+9fR4YOuBwFO/eX1AzxJn6icS/XQp9+JIJtVKNbdV30t0fyF efXSBIzsfo3AR6mwh5kfA3AVIy+RuzTpUORXvyuc1MGcBwTQT9zjXDAJv6pPE5U2vFHg z7Pyxkw82MGguJ9ZBZh2kjOgIrEExVhc1b9VH0CFXLKHpozisWaduyZwoaWzf/wVkJ08 m920KxLZkTOSr+XyfJyoboJvex9j0FBwctDQnnVbsVfL0oqyU/unFj/jMNVGs3TQf0Lb FekA== 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=FkD88N9klqxKXsAY9SBtglKOqSdzVSbWa7tDOlZmx2E=; b=RNc4p/lkH18omwyGY21Y/Z3G5uCFqKzlIJn6X8pzTHaahAxBZCCLavymhC8PXj9HyV uVecj7u1ST2Ms3c9WMrKa9AmcphmwYrItaJ17yxuBOXoU+obYd9Aw3gOv4ZOTWbEzYT3 iXYScj1NcYA/MBNlgzAPSeGjsNU8xGljVLFnelk8Au2+5rvg7rSbCP8QsCtC23PsGv7J Zft8B9T5vviS9ZiHcR4ZCWLJXQrmqVbgGBhSAskZn4J4Y3gaC56dmUCwUG3yHc3FI8CG bKhamUUIxdsOnynme1FjSzUKmkf06cr2/Varud08Wo+XSCuMaDmAXtIs2WL8iHTagT3O wPkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yLtn1MMj; 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 p3-20020a170902e74300b00176a87603dbsi559104plf.156.2022.10.24.13.39.38; Mon, 24 Oct 2022 13:39:52 -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=yLtn1MMj; 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 S234379AbiJXUi2 (ORCPT + 99 others); Mon, 24 Oct 2022 16:38:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234328AbiJXUhy (ORCPT ); Mon, 24 Oct 2022 16:37:54 -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 92FB79258D; Mon, 24 Oct 2022 11:49:19 -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 909E0B81257; Mon, 24 Oct 2022 12:07:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8C6FC433C1; Mon, 24 Oct 2022 12:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613261; bh=4kuhib7yZhV84x31Vuyv9TsHCqSc7etGBr9ReZnR+PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yLtn1MMjOOP/0L2Y6V+FWfdodmCpr2gy+m2IdHxo63ZdK5ZwHneLt/wOb3J6vcJNn 8qvkiJkQaFZJDthMC570JfTV29cIpd/TC+5nIrQAqON7AWf/UKmfkhUWojp+8Jjy7b WNb1jgdOebM6muBCxflzRoI9aGOTt0PIr4+WiW6E= 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.4 070/255] wifi: rtl8xxxu: Fix skb misuse in TX queue selection Date: Mon, 24 Oct 2022 13:29:40 +0200 Message-Id: <20221024113004.845254874@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747602891362387896?= X-GMAIL-MSGID: =?utf-8?q?1747602891362387896?= 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 3062103e216a..977ebb647c0e 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -4950,6 +4950,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); @@ -4962,7 +4964,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) {