netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] nexthop: More fine-grained policies for netlink message validation
@ 2021-01-18 14:05 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
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Petr Machata @ 2021-01-18 14:05 UTC (permalink / raw)
  To: netdev
  Cc: David Ahern, David S. Miller, Jakub Kicinski, Ido Schimmel, Petr Machata

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(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-01-20 11:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).