Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1775986pxp; Mon, 7 Mar 2022 02:03:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJy77QK++MOZDx/A5604QUSjkl083V1Zr4zLZFrGAP9BiFq7cc+6JJWv4nWAVPy96yaBr5cm X-Received: by 2002:a17:902:7102:b0:151:ef50:32ec with SMTP id a2-20020a170902710200b00151ef5032ecmr2808613pll.50.1646647390612; Mon, 07 Mar 2022 02:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646647390; cv=none; d=google.com; s=arc-20160816; b=to+XKaIiKv+D9ZSqs4ry+fFy95yQjb5K/RqSQsJU6R8gXNIumSPJu3QmE9I2LL+iJE tRYa6nvl+DQ2kxg+iwIBu2cVkOoyVEcKmF+d/sfU85fjE0vH5HjcCiFhP0c/qN+Al6Gt TxsG8C/wcwJZ6zqG4cbM6H6BKeN/8n9C2rXFcFxOwA6RNePtA/P5jIcc5NK75AsMxR28 G+0RFIQ7U7gdDBrxe+Lscab3I8iubALKeEbCdw2keq59CBafQHwM/jSfNXs9XW1eSUed tKQQyE5F9QLnsNI7k0kxd9OBa91e/b/9CtDqjdDsZr3Pydze8IXrOaxu6D7patkBW5tj tFlA== 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=uD69vxU3McssNNHdxqgo1yIhAU2vBpKnTuOc+/L/hYw=; b=x1SKmi8LpHTwaZS9TQn6AlQgDNmGWVoL06ZrDSILLXBPow3z3KzPupxdG+7+kLZr4S YVpgqkUpl/2ORfOl5LhsV454eIz9R/ktDxoQCzjQlP+r6+nEbn7z7juf2q6mBri8w87r ZVpbqls2cZje6WnZJF5JNwM4rD2GhKFnPwckwKE6JitdpDjGZpCRtXK0pnldQibaHUwH rnWWpn8jbtIsTvHdgy8wZvejw1iF3XMuvW0/9dqy+CVGpBdVTkcfIik32XS4pI0QDHN8 S+kcohWPaatw313WQc2BozrVd3CPzJZ0Qb/DIqAGbn2ns2mY3p5G60kTMCQWxioCR+wp TLKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s27szqTz; 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 kb3-20020a17090ae7c300b001bee2a5a5f1si425176pjb.132.2022.03.07.02.02.55; Mon, 07 Mar 2022 02:03:10 -0800 (PST) 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=s27szqTz; 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 S237058AbiCGJ1M (ORCPT + 99 others); Mon, 7 Mar 2022 04:27:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237143AbiCGJX1 (ORCPT ); Mon, 7 Mar 2022 04:23:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67A81674F0; Mon, 7 Mar 2022 01:21:55 -0800 (PST) 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 09A40B81054; Mon, 7 Mar 2022 09:21:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49482C340E9; Mon, 7 Mar 2022 09:21:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646644912; bh=UgKQ9cNGkty3xwnvfNTkiGfr/Fg+lnlS4rwHrsaA3To=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s27szqTzWomqTfZziKFlAR8Ot9qLkg1HNoUtfe89g2e/TYkBQtkPshalKHA2V0+4M y9wkzXlgjsUhUrmX5uQQdDZQ88d2maR6iG8v8AkHT38K4JNJiWeZ9Nt7LJAaeshG7y kYigk6+6/KJ+mhJjmSy0ZyoFGJR+/mmXJ/25oeL0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, JaeMan Park , Johannes Berg , Sasha Levin Subject: [PATCH 4.14 02/42] mac80211_hwsim: initialize ieee80211_tx_info at hw_scan_work Date: Mon, 7 Mar 2022 10:18:36 +0100 Message-Id: <20220307091636.219436504@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307091636.146155347@linuxfoundation.org> References: <20220307091636.146155347@linuxfoundation.org> User-Agent: quilt/0.66 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,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-kernel@vger.kernel.org From: JaeMan Park [ Upstream commit cacfddf82baf1470e5741edeecb187260868f195 ] In mac80211_hwsim, the probe_req frame is created and sent while scanning. It is sent with ieee80211_tx_info which is not initialized. Uninitialized ieee80211_tx_info can cause problems when using mac80211_hwsim with wmediumd. wmediumd checks the tx_rates field of ieee80211_tx_info and doesn't relay probe_req frame to other clients even if it is a broadcasting message. Call ieee80211_tx_prepare_skb() to initialize ieee80211_tx_info for the probe_req that is created by hw_scan_work in mac80211_hwsim. Signed-off-by: JaeMan Park Link: https://lore.kernel.org/r/20220113060235.546107-1-jaeman@google.com [fix memory leak] Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/mac80211_hwsim.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index b19d19c4be272..ee1eb14ae8fc9 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -2025,6 +2025,15 @@ static void hw_scan_work(struct work_struct *work) if (req->ie_len) skb_put_data(probe, req->ie, req->ie_len); + if (!ieee80211_tx_prepare_skb(hwsim->hw, + hwsim->hw_scan_vif, + probe, + hwsim->tmp_chan->band, + NULL)) { + kfree_skb(probe); + continue; + } + local_bh_disable(); mac80211_hwsim_tx_frame(hwsim->hw, probe, hwsim->tmp_chan); -- 2.34.1