Message ID | 20221013175147.217997359@linuxfoundation.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp412563wrs; Thu, 13 Oct 2022 11:11:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5inxWERj9aZJXj5wdP/+oGQ27TKedqkxAiahJv2WzaR9K1b4cURaG5oEhC11JaWbCKmXR6 X-Received: by 2002:a63:1c47:0:b0:44c:2476:12ff with SMTP id c7-20020a631c47000000b0044c247612ffmr1053946pgm.50.1665684659889; Thu, 13 Oct 2022 11:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665684659; cv=none; d=google.com; s=arc-20160816; b=B6AftvhJlgm4SKCrgB5wl9KoUe7aIiCq0XwUSM7AhzDPgrhcMe+uNfkwI6qE85akyX dGsR1WhErwjBq0qwZV+utjH4UtKJC1yxJgC4O8gEjuCEJzCtEjphY94UCWfNnmYLNJBo ZEIYwmebuwSXE4GgAQI7lqXCAgpfxRmW08eyUWFFvRJ0hKM47EMghggVOZpeJ16yIzEH vdHCHQCWlpwEVPLa2r/3k6v7S7Sj6aWAL5NF6ee//WAYW/mSrFruh09d1sDx599+aaF9 OwlG/G7OOeY/96r4OTQARJ6MbIdFw/ktGaoymOGp0Jl2n0SCDGC1pVDtoqnPSlZpnae/ QQhA== 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=7h7yQGiFQYJgDf3aJgGMbshNi+0f74pGBK9Hn7HXU8g=; b=F1EW6W5Jk6WLDQ61CrBEaI6K+jDFtBzecGpg14N85qXMGeOwK5ELKzFpcIh7LNC7Ie j8xCZR5X/Fk0mDFTY8/bC748Trfn37BYHZgdfXQlRmNKCQ/ZP+kXYDuC4ubui5I/nYSr CQ1pLp9i8APjiIqnzgGrLYVGTdGiKc2JGYDe8JzZ038ehqXBDg6kPd3tw5mjkgnx4FkS 4Tz9M1RkSyBOCcn3hTfpViEA6AKyN6HJp6h2nnKZ+d4FCdOIklZHmSPB8rPXK/ZWXpPm slHKFXKpcPSPn6j/lex4VxhVWPlhM0lW8xUsU2jKXzeMF0jmefnGk/4+tquIlATHlViR Ioqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pYxm0nnD; 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 pt6-20020a17090b3d0600b0020a47a4c951si157733pjb.147.2022.10.13.11.10.46; Thu, 13 Oct 2022 11:10:59 -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=pYxm0nnD; 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 S231130AbiJMSKi (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Thu, 13 Oct 2022 14:10:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231182AbiJMSKE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Oct 2022 14:10:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D608DB854; Thu, 13 Oct 2022 11:07:36 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D2BFD6194B; Thu, 13 Oct 2022 18:01:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1C2EC433D7; Thu, 13 Oct 2022 18:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665684107; bh=GRz9I5d9zHaKVHe3ziSUKmLW6FeLmSChjvrYLTtRYLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pYxm0nnDyflsJi6blqVNks5K3D0GVBOobuwViEyYsF05gnbX7yNQIltdhcz24mMma t7gh83ZYKh40AN0b1ExbydJ4uE183m8VsGkfoU7TygWWarAkSl7tgfCBC34tso+Qmh eKH0wSH42MqM4HVgLKs4ZLmnkVXgJRIU9MK12iww= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, =?utf-8?q?S=C3=B6nke_Huster?= <shuster@seemoo.tu-darmstadt.de>, Johannes Berg <johannes.berg@intel.com> Subject: [PATCH 6.0 27/34] wifi: mac80211_hwsim: avoid mac80211 warning on bad rate Date: Thu, 13 Oct 2022 19:53:05 +0200 Message-Id: <20221013175147.217997359@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221013175146.507746257@linuxfoundation.org> References: <20221013175146.507746257@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.1 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746596957829431323?= X-GMAIL-MSGID: =?utf-8?q?1746596957829431323?= |
Series |
None
|
|
Commit Message
Greg KH
Oct. 13, 2022, 5:53 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com> commit 1833b6f46d7e2830251a063935ab464256defe22 upstream. If the tool on the other side (e.g. wmediumd) gets confused about the rate, we hit a warning in mac80211. Silence that by effectively duplicating the check here and dropping the frame silently (in mac80211 it's dropped with the warning). Reported-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de> Tested-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/net/wireless/mac80211_hwsim.c | 2 ++ 1 file changed, 2 insertions(+)
--- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -4526,6 +4526,8 @@ static int hwsim_cloned_frame_received_n rx_status.band = channel->band; rx_status.rate_idx = nla_get_u32(info->attrs[HWSIM_ATTR_RX_RATE]); + if (rx_status.rate_idx >= data2->hw->wiphy->bands[rx_status.band]->n_bitrates) + goto out; rx_status.signal = nla_get_u32(info->attrs[HWSIM_ATTR_SIGNAL]); hdr = (void *)skb->data;