From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0DE7C433DB for ; Mon, 18 Jan 2021 18:38:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEE0A22C9E for ; Mon, 18 Jan 2021 18:38:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406074AbhARSim (ORCPT ); Mon, 18 Jan 2021 13:38:42 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:47791 "EHLO wout5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405569AbhARSaD (ORCPT ); Mon, 18 Jan 2021 13:30:03 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 948D3184D; Mon, 18 Jan 2021 13:29:14 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 18 Jan 2021 13:29:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Co/Fyp WzxPWa5HbJGkpGwvIvXJcCzicqQuTSYLp7rRs=; b=aOLS20IQ+mvU35IEIds8FU J3NZeVCgwz5c4GsHIhIOETqmtbZzxC8x2evGBfWhS9Z4M0TNK72B8RN+fuJH3+jD oQ3JeMNNDp0rQe6OgSPGCVGMcB6Nk8tTIGz4VIbIIgCBCSYd6K+7KxASlAz0uNxV yhK9uHTBUJ1/yJF/hDq4gw3v5ju+zUBsRJ60LZsHr0Kd7lhE6M8zz5DJ9xlccI5E R+aC6BSar1xkcR4ckv2oTWOijnD8oqG4NTCZz0hIWmDeVoSu4whp0wsxLe983Q10 eI4GnONjGsbNIE8f/XrsOvyrPKyN3B2TMGmZZoLKWz2ayHFXIGpiKnLUimuyyv7w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdekgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefkughoucfu tghhihhmmhgvlhcuoehiughoshgthhesihguohhstghhrdhorhhgqeenucggtffrrghtth gvrhhnpedtffekkeefudffveegueejffejhfetgfeuuefgvedtieehudeuueekhfduheel teenucfkphepkeegrddvvdelrdduheefrdeggeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehiughoshgthhesihguohhstghhrdhorhhg X-ME-Proxy: Received: from localhost (igld-84-229-153-44.inter.net.il [84.229.153.44]) by mail.messagingengine.com (Postfix) with ESMTPA id 9ED8E240066; Mon, 18 Jan 2021 13:29:13 -0500 (EST) Date: Mon, 18 Jan 2021 20:29:10 +0200 From: Ido Schimmel To: David Ahern Cc: Petr Machata , netdev@vger.kernel.org, David Ahern , "David S. Miller" , Jakub Kicinski , Ido Schimmel , Petr Machata Subject: Re: [PATCH net-next 0/3] nexthop: More fine-grained policies for netlink message validation Message-ID: <20210118182910.GA2334694@shredder.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Jan 18, 2021 at 10:43:22AM -0700, David Ahern wrote: > On 1/18/21 7:05 AM, Petr Machata wrote: > > From: Petr Machata > > > > There is currently one policy that covers all attributes for next hop > > object management. Actual validation is then done in code, which makes it > > unobvious which attributes are acceptable when, and indeed that everything > > is rejected as necessary. > > > > In this series, split rtm_nh_policy to several policies that cover various > > aspects of the next hop object configuration, and instead of open-coding > > the validation, defer to nlmsg_parse(). This should make extending the next > > hop code simpler as well, which will be relevant in near future for > > resilient hashing implementation. > > > > This was tested by running tools/testing/selftests/net/fib_nexthops.sh. > > Additionally iproute2 was tweaked to issue "nexthop list id" as an > > RTM_GETNEXTHOP dump request, instead of a straight get to test that > > unexpected attributes are indeed rejected. > > > > In patch #1, convert attribute validation in nh_valid_get_del_req(). > > > > In patch #2, convert nh_valid_dump_req(). > > > > In patch #3, rtm_nh_policy is cleaned up and renamed to rtm_nh_policy_new, > > because after the above two patches, that is the only context that it is > > used in. > > > > Petr Machata (3): > > nexthop: Use a dedicated policy for nh_valid_get_del_req() > > nexthop: Use a dedicated policy for nh_valid_dump_req() > > nexthop: Specialize rtm_nh_policy > > > > net/ipv4/nexthop.c | 85 +++++++++++++++++----------------------------- > > 1 file changed, 32 insertions(+), 53 deletions(-) > > > > good cleanup. thanks for doing this. Did you run fib_nexthops.sh > selftests on the change? Seems right, but always good to run that script > which has functional tests about valid attribute combinations. "This was tested by running tools/testing/selftests/net/fib_nexthops.sh" :)