From patchwork Tue Jul 18 07:52:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Westphal X-Patchwork-Id: 13316822 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC8C353BF for ; Tue, 18 Jul 2023 07:53:03 +0000 (UTC) Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABEEA8E; Tue, 18 Jul 2023 00:53:01 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qLfVo-0005d0-Qm; Tue, 18 Jul 2023 09:52:48 +0200 From: Florian Westphal To: Cc: Pablo Neira Ayuso , Jakub Kicinski , Paolo Abeni , Eric Dumazet , "David S. Miller" , , Florian Westphal Subject: [PATCH nf-next 0/2] netfilter: nf_tables: use NLA_POLICY_MASK instead of manual checks Date: Tue, 18 Jul 2023 09:52:28 +0200 Message-ID: <20230718075234.3863-1-fw@strlen.de> X-Mailer: git-send-email 2.41.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,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 nf_tables still uses manual attribute validation in multiple places. Make NLA_POLICY_MASK available with NLA_BE16/NLA_BE32 and then start using it for flag attribute validation. Florian Westphal (2): netlink: allow be16 and be32 types in all uint policy checks netfilter: nf_tables: use NLA_POLICY_MASK to test for valid flag options include/net/netlink.h | 10 +++------- lib/nlattr.c | 6 ++++++ net/netfilter/nft_fib.c | 13 +++++++------ net/netfilter/nft_lookup.c | 6 ++---- net/netfilter/nft_masq.c | 8 +++----- net/netfilter/nft_nat.c | 8 +++----- net/netfilter/nft_redir.c | 8 +++----- 7 files changed, 27 insertions(+), 32 deletions(-)