netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: David Ahern <dsahern@gmail.com>
Cc: Petr Machata <petrm@nvidia.com>,
	netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.org>
Subject: Re: [PATCH net-next 0/3] nexthop: More fine-grained policies for netlink message validation
Date: Mon, 18 Jan 2021 20:29:10 +0200	[thread overview]
Message-ID: <20210118182910.GA2334694@shredder.lan> (raw)
In-Reply-To: <f2ba918f-6781-3740-fe49-756fe4fb40c5@gmail.com>

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 <petrm@nvidia.org>
> > 
> > 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"
:)

      reply	other threads:[~2021-01-18 18:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 14:05 [PATCH net-next 0/3] nexthop: More fine-grained policies for netlink message validation Petr Machata
2021-01-18 14:05 ` [PATCH net-next 1/3] nexthop: Use a dedicated policy for nh_valid_get_del_req() Petr Machata
2021-01-18 17:41   ` David Ahern
2021-01-19 20:55   ` Jakub Kicinski
2021-01-20  2:28     ` David Ahern
2021-01-20  2:35       ` Jakub Kicinski
2021-01-20 10:45       ` Petr Machata
2021-01-18 14:05 ` [PATCH net-next 2/3] nexthop: Use a dedicated policy for nh_valid_dump_req() Petr Machata
2021-01-18 17:41   ` David Ahern
2021-01-19 20:55   ` Jakub Kicinski
2021-01-20 10:46     ` Petr Machata
2021-01-18 14:05 ` [PATCH net-next 3/3] nexthop: Specialize rtm_nh_policy Petr Machata
2021-01-18 17:42   ` David Ahern
2021-01-18 17:43 ` [PATCH net-next 0/3] nexthop: More fine-grained policies for netlink message validation David Ahern
2021-01-18 18:29   ` Ido Schimmel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210118182910.GA2334694@shredder.lan \
    --to=idosch@idosch.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=petrm@nvidia.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).