Skip to content

RFC devlink: add policy check for all attributes

Jacob Keller netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6mnlg: remove unnused mnlg_socket structuredevlink/mnlg.c+0 -80 replies
2/6utils: extract CTRL_ATTR_MAXATTR and save itinclude/mnl_utils.h lib/mnl_utils.c+13 -60 replies
3/6mnl_utils: add function to dump command policyinclude/mnl_utils.h lib/mnl_utils.c+267 -00 replies
4/6devlink: use dl_no_arg instead of checking dl_argc == 0devlink/devlink.c+16 -160 replies
5/6devlink: remove dl_argv_parse_putdevlink/devlink.c+317 -2490 replies
6/6devlink: check attributes against policydevlink/devlink.c+347 -1050 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC iproute2 0/6] devlink: add policy check for all attributes

This series implements code to check the kernel policy for the devlink commands to determine whether or not attributes are supported before adding them to netlink messages.

It implements a new mnlu_gen_get_op_policy to extract the policy information, and uses it to implement checks when parsing option arguments. This is intended to eventually go along with improvements to the policy reporting in devlink kernel code to report separate policy for each command.

I think checking every attribute makes sense and is easier to follow than only checking specific attributes. This will help ensure that future attributes don't accidentally get sent to commands when they aren't supported (once the devlink kernel policy is improved to report correct information for each command separately).

Cc Jacob Keller <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Jiri Pirko <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
Cc David Ahern <[email protected]>
Cc Stephen Hemminger <[email protected]>

Jacob Keller (6):
mnlg: remove unnused mnlg_socket structure
utils: extract CTRL_ATTR_MAXATTR and save it
mnl_utils: add function to dump command policy
devlink: use dl_no_arg instead of checking dl_argc == 0
devlink: remove dl_argv_parse_put
devlink: check attributes against policy

 devlink/devlink.c   | 846 ++++++++++++++++++++++++++++++--------------
 devlink/mnlg.c      |   8 -
 include/mnl_utils.h |  28 ++
 lib/mnl_utils.c     | 258 +++++++++++++-
 4 files changed, 858 insertions(+), 282 deletions(-)
Signature · 1 line
2.37.1.208.ge72d93e88cb2