From patchwork Fri Jan 19 09:37:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lin Ma X-Patchwork-Id: 189461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp895333dyb; Fri, 19 Jan 2024 01:38:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhnKgFzKRQUHLBpxIlu53lLJMZ5835kyYu3Ls5NzrOqG+6kDygMCzTYI27fKkTotzvETS2 X-Received: by 2002:a05:6e02:581:b0:35d:6a77:64c9 with SMTP id c1-20020a056e02058100b0035d6a7764c9mr2180282ils.37.1705657107667; Fri, 19 Jan 2024 01:38:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705657107; cv=pass; d=google.com; s=arc-20160816; b=tnNOpMlFU+HOiysvmgfK6sP0E4cZLuvhXl83+qwRojzOdfPDQBbLzJdKhurhinPcMF BYN/WI1VIqtfN4/0KnqoEGwfGbEFE9OZeY+vto50dipLeJih3T7SSSENOAlX2+5NhOsC TpobdD4hjsQIspGvEEar88O/HP1RSGexFt1b0vDtf4EK7sqvGoAI69bUh1b9yKP9jcSR 4ZOCw2LZMOK0rx9n4ZAJhJDLdopY1THe545SVK6O12GpRqRsNmKTUQPnY4NaWy5V+Ctj +1Su4cVIGR+d+o55s17/00wsaInQf/hrOtRTAy4MFcpdd+pNCFLjjZSz8l2Dx8U2cJi5 RJPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=zyEnSzGEs/NbRqNr1j4FAre+g5L7lBPI40ukysn9rJc=; fh=mqGjzgul6sfdGmnR/oeSCc6TzWzuLBMFT2WeofiCcj0=; b=tFMcn2OgLFS/Q5r7ZfZLuH89SSIxDZzRlfPPQu8sjp5QwEHYfuxpLiYtsOAHSB/wHx dnMhoq4qqsGyGVpcHt6jNmcH05jpYGjnFVZF4Xl4DRhXR7oKXIjvg3wxcs83fjS4rw6I bfIfAHrZ7PlIxpm+yt+aHaN3CvYGjM3kPwbhy/IX3pCkrfSwiFW/zxbSMxswdTrl2Z6R yH0Z61xmaOwVzhL0cQri8bwH99mmMR0nbrZFB7XcsrgrZkZkbMwX+cA7Xe25nyHytD6J 0uGG0uNJUCHLP1dLhfQG3WmZvMDwJormiEAqFNtfl5RkTqwbexJL7kFQRat9yYUJf6jI EpCA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=zju.edu.cn); spf=pass (google.com: domain of linux-kernel+bounces-30959-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30959-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a2-20020a656542000000b005cddb358d59si3058380pgw.824.2024.01.19.01.38.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 01:38:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30959-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=zju.edu.cn); spf=pass (google.com: domain of linux-kernel+bounces-30959-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30959-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6A150285197 for ; Fri, 19 Jan 2024 09:38:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DFDD3CF40; Fri, 19 Jan 2024 09:37:55 +0000 (UTC) Received: from azure-sdnproxy.icoremail.net (azure-sdnproxy.icoremail.net [52.237.72.81]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB5271EB52; Fri, 19 Jan 2024 09:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.237.72.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705657074; cv=none; b=aVw7nF/kkkvTIT9QjO/CKIwpfbvhseC3BXoZbLWzfWEhzAHPcclxHGKS9ILP9VLtMZFPyvCIy7TbmXSId5jeMl5SoCLKA2+iW/wDXRLhtnZGAWL2pwP/fh5VlfcW/V2DCfALonsaKe6lIiwvsq+sz/U9nCzw1jUvxCQKlxoaaRk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705657074; c=relaxed/simple; bh=fhRyHl9d9j86uNZdgU/t59QbpKu7S7LsJf51vQuHOmA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=NzTgUyp9RsKCdx1k1H70ej7fLOW0fu5jID8dxZPLD6khi1B+3En9/fAaxK3Cn4j/IdZ6fL9BPi50LZeoLBX3zp57nNcwc7RD9DpnxDyksgMWPvYUaLAwf+66n8o+bSbAP//E/SMWjICPURcGc2CpKWQeas7EhnT6rPwlIXdZZEA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zju.edu.cn; spf=pass smtp.mailfrom=zju.edu.cn; arc=none smtp.client-ip=52.237.72.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zju.edu.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zju.edu.cn Received: from cmd.. (unknown [39.174.92.167]) by mail-app4 (Coremail) with SMTP id cS_KCgBHY4LZQqplMTVLAA--.7396S2; Fri, 19 Jan 2024 17:37:30 +0800 (CST) From: Lin Ma To: djohannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lin Ma Subject: [PATCH net-next v1] nl80211/cfg80211: add nla_policy for S1G band Date: Fri, 19 Jan 2024 17:37:24 +0800 Message-Id: <20240119093724.7852-1-linma@zju.edu.cn> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: cS_KCgBHY4LZQqplMTVLAA--.7396S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Cw18tF1xZr4Utw1xCrykZrb_yoW8XFWkpr WDJFZFy347tw47JFWrCa18XasrXanrG34rur4YyFyxZ3Z0gw1FqFyY93W3tr1fZFs5t34r XF4ktw15t3Wa93JanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkG14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4U JVW0owA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY1x0262kKe7AKxVWU tVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14 v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkG c2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4U MIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUd-B_UUU UU= X-CM-SenderInfo: qtrwiiyqvtljo62m3hxhgxhubq/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788511107179553687 X-GMAIL-MSGID: 1788511107179553687 Our detector has identified another case of an incomplete policy. Specifically, the commit df78a0c0b67d ("nl80211: S1G band and channel definitions") introduced the NL80211_BAND_S1GHZ attribute to nl80211_band, but it neglected to update the nl80211_match_band_rssi_policy accordingly. Similar commits that add new band types, such as the initial commit 1e1b11b6a111 ("nl80211/cfg80211: Specify band specific min RSSI thresholds with sched scan"), the commit e548a1c36b11 ("cfg80211: add 6GHz in code handling array with NUM_NL80211_BANDS entries"), and the commit 63fa04266629 ("nl80211: Add LC placeholder band definition to nl80211_band"), all require updates to the policy. Failure to do so could result in accessing an attribute of unexpected length in the function nl80211_parse_sched_scan_per_band_rssi. To resolve this issue, this commit adds the policy for the NL80211_BAND_S1GHZ attribute. Signed-off-by: Lin Ma --- net/wireless/nl80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 60877b532993..980300621a60 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -911,6 +911,7 @@ nl80211_match_band_rssi_policy[NUM_NL80211_BANDS] = { [NL80211_BAND_5GHZ] = { .type = NLA_S32 }, [NL80211_BAND_6GHZ] = { .type = NLA_S32 }, [NL80211_BAND_60GHZ] = { .type = NLA_S32 }, + [NL80211_BAND_S1GHZ] = { .type = NLA_S32 }, [NL80211_BAND_LC] = { .type = NLA_S32 }, };