From patchwork Tue Mar 3 05:10:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 11417183 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22E4814B4 for ; Tue, 3 Mar 2020 05:11:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF13420CC7 for ; Tue, 3 Mar 2020 05:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583212271; bh=6haNE0t4L7XP3kqs2nre8rVY0GF2T4MZ+TIai8tnIWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t+u4TZzGSO2VzeHVZSJFPi+hlNDdXJ4JNmSm7/VuILKJsUWNBRuVqCJzJ+/ME0DF9 /Dn05metyFt7kQHDpEKDcFCtEAX6LvUtBvqSCAxy9XZNVUiy+qrMPbuCTHyrw6UXHf gBjKakZIngupYeE0jzTYuXGVOV/YfPiaXk8CHAX4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727406AbgCCFLJ (ORCPT ); Tue, 3 Mar 2020 00:11:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:43442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbgCCFLJ (ORCPT ); Tue, 3 Mar 2020 00:11:09 -0500 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 419A0214D8; Tue, 3 Mar 2020 05:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583212268; bh=6haNE0t4L7XP3kqs2nre8rVY0GF2T4MZ+TIai8tnIWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l1zmIJjg5k7zy4T3PUeETLudVEkV2+3xg7daHHRq5dE63ESV+uhaGFSqMub5uWt8f TXdl2LL6NCgwiraWBjjbWwvxL2NfjkBU2C8nd62TPyCtr+UIHV6QyznIsEk2td9L9o BY+TtwMpfUwSgbkkMfvG08x2ZYdroAxfiBA+BHtE= From: Jakub Kicinski To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, kvalo@codeaurora.org, Jakub Kicinski , "Franky (Zhenhui) Lin" , Arend van Spriel , Pieter-Paul Giesberts Subject: [PATCH wireless 1/3] nl80211: add missing attribute validation for critical protocol indication Date: Mon, 2 Mar 2020 21:10:56 -0800 Message-Id: <20200303051058.4089398-2-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200303051058.4089398-1-kuba@kernel.org> References: <20200303051058.4089398-1-kuba@kernel.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add missing attribute validation for critical protocol fields to the netlink policy. Fixes: 5de17984898c ("cfg80211: introduce critical protocol indication from user-space") Signed-off-by: Jakub Kicinski --- CC: "Franky (Zhenhui) Lin" CC: Arend van Spriel CC: Pieter-Paul Giesberts Leaving the conversion to RANGE to a follow up, as this may get stabled. --- net/wireless/nl80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 5b19e9fac4aa..cd0e024d7cb6 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -531,6 +531,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_MDID] = { .type = NLA_U16 }, [NL80211_ATTR_IE_RIC] = { .type = NLA_BINARY, .len = IEEE80211_MAX_DATA_LEN }, + [NL80211_ATTR_CRIT_PROT_ID] = { .type = NLA_U16 }, + [NL80211_ATTR_MAX_CRIT_PROT_DURATION] = { .type = NLA_U16 }, [NL80211_ATTR_PEER_AID] = NLA_POLICY_RANGE(NLA_U16, 1, IEEE80211_MAX_AID), [NL80211_ATTR_CH_SWITCH_COUNT] = { .type = NLA_U32 }, From patchwork Tue Mar 3 05:10:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 11417185 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DB6992A for ; Tue, 3 Mar 2020 05:11:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CF8F20CC7 for ; Tue, 3 Mar 2020 05:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583212273; bh=Acem9Yk+8J44gj1pR+rzc2aijA4WBRsn1xT2ymQr8cM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=e/YTqGEMqpEwhk+XkamTQENgftZh/9mAzPX+qWuMtFCfN2JHU1K1RihIoFXOv+pRV ZfwVslO9WdNmUy7udL24H2BeclAujexABineqZy5ONp+LBH2rOEiU3ax7o9xazQhaH C3+B1uj5yeKrtlKtTJZPAXTAp3VFzO3MR2gYlN48= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727446AbgCCFLL (ORCPT ); Tue, 3 Mar 2020 00:11:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:43462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbgCCFLJ (ORCPT ); Tue, 3 Mar 2020 00:11:09 -0500 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE013215A4; Tue, 3 Mar 2020 05:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583212269; bh=Acem9Yk+8J44gj1pR+rzc2aijA4WBRsn1xT2ymQr8cM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RSLVAND9qeTgDW85OERPRM+/L0Cq3cuaeWRnZlf1Bv+X1SRYlBNJ9QFNR04vJlOYc xA7A4fSdL2jSsHDWubyt8gCJySRqVYU6rEoMyzX7V8O4G6V5lcsUO/E9xgV7fxPSX4 nWV5SEPFdJiSPa0WvYP4cE5kpIYujU7Rn0qyinGI= From: Jakub Kicinski To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, kvalo@codeaurora.org, Jakub Kicinski , David Spinadel , Luca Coelho , Avraham Stern , Assaf Krauss Subject: [PATCH wireless 2/3] nl80211: add missing attribute validation for beacon report scanning Date: Mon, 2 Mar 2020 21:10:57 -0800 Message-Id: <20200303051058.4089398-3-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200303051058.4089398-1-kuba@kernel.org> References: <20200303051058.4089398-1-kuba@kernel.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add missing attribute validation for beacon report scanning to the netlink policy. Fixes: 1d76250bd34a ("nl80211: support beacon report scanning") Signed-off-by: Jakub Kicinski --- CC: David Spinadel CC: Luca Coelho CC: Avraham Stern CC: Assaf Krauss --- net/wireless/nl80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index cd0e024d7cb6..48e6508aba52 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -470,6 +470,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_WOWLAN_TRIGGERS] = { .type = NLA_NESTED }, [NL80211_ATTR_STA_PLINK_STATE] = NLA_POLICY_MAX(NLA_U8, NUM_NL80211_PLINK_STATES - 1), + [NL80211_ATTR_MEASUREMENT_DURATION] = { .type = NLA_U16 }, + [NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY] = { .type = NLA_FLAG }, [NL80211_ATTR_MESH_PEER_AID] = NLA_POLICY_RANGE(NLA_U16, 1, IEEE80211_MAX_AID), [NL80211_ATTR_SCHED_SCAN_INTERVAL] = { .type = NLA_U32 }, From patchwork Tue Mar 3 05:10:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 11417187 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 58E0B14B4 for ; Tue, 3 Mar 2020 05:11:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2CEFF2146E for ; Tue, 3 Mar 2020 05:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583212274; bh=3g/nS2QPU8iYCOIqxGuzFG/Tz8mgplaIyPPBhcSeaIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=WmeehKzXbDbbHX6b3wP+AGasyJ7OXEoIyv5Oy/ZSNyBRGKVBH/8n8UDk9CiAGxrIK rW8STMP1fjuTi9N/GOgcC0dd6beUBlENvcvdVpB9M/guYz1dP7tpvUNq1gFazAn6QM 9CNhjLsOYCqm9Vc1c57vBOvrDK6sSj2SKhFxzrn4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727423AbgCCFLK (ORCPT ); Tue, 3 Mar 2020 00:11:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:43476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727409AbgCCFLK (ORCPT ); Tue, 3 Mar 2020 00:11:10 -0500 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F48C2173E; Tue, 3 Mar 2020 05:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583212269; bh=3g/nS2QPU8iYCOIqxGuzFG/Tz8mgplaIyPPBhcSeaIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tIQg38ZPj6yJYZTrYvyIsHqxVyZJ+AN6cdwCY/49hSNLBL3Kjg4NN43eWlYBE2Pbw heapgX+fHa0pO8sb/tOWVfr3MZa89RHRfiF38Nc5deZgmgfJoVArwYu44QwZVOVf6U jsQuC1R97DwKHPNa+w9MfAjLtFDw0rK+mGc81jic= From: Jakub Kicinski To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, kvalo@codeaurora.org, Jakub Kicinski , Arik Nemtsov Subject: [PATCH wireless 3/3] nl80211: add missing attribute validation for channel switch Date: Mon, 2 Mar 2020 21:10:58 -0800 Message-Id: <20200303051058.4089398-4-kuba@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200303051058.4089398-1-kuba@kernel.org> References: <20200303051058.4089398-1-kuba@kernel.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add missing attribute validation for NL80211_ATTR_OPER_CLASS to the netlink policy. Fixes: 1057d35ede5d ("cfg80211: introduce TDLS channel switch commands") Signed-off-by: Jakub Kicinski --- CC: Arik Nemtsov --- net/wireless/nl80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 48e6508aba52..ec5d67794aab 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -565,6 +565,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { NLA_POLICY_MAX(NLA_U8, IEEE80211_NUM_UPS - 1), [NL80211_ATTR_ADMITTED_TIME] = { .type = NLA_U16 }, [NL80211_ATTR_SMPS_MODE] = { .type = NLA_U8 }, + [NL80211_ATTR_OPER_CLASS] = { .type = NLA_U8 }, [NL80211_ATTR_MAC_MASK] = { .type = NLA_EXACT_LEN_WARN, .len = ETH_ALEN