Skip to content

genetlink: support per op type policies

Jakub Kicinski netdev 3 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest13 patches 0 repliesApplied 13/13
  2. v213 patches 9 repliesSuperseded
  3. v113 patches 32 repliesSuperseded

Changes in v3 from the cover letter

- minor fixes to patch 12 after I took it for a spin with a real family
- adjust commit msg in patch 8
v2: https://lore.kernel.org/all/[email protected]/
- wait for net changes to propagate
- restore the missing comment in patch 1
- drop extra space in patch 3
- improve commit message in patch 4
v1: https://lore.kernel.org/all/[email protected]/

Patches in v3 All 13 applied

#Subject and filesSizeRepliesApplied
1/13genetlink: refactor the cmd <> policy mapping dumpnet/netlink/genetlink.c+15 -120 repliesApplied
2/13genetlink: move the private fields in struct genl_familyinclude/net/genetlink.h+6 -50 repliesApplied
3/13genetlink: introduce split op representationinclude/net/genetlink.h net/batman-adv/netlink.c net/core/devlink.c +4 more+136 -290 repliesApplied
4/13genetlink: load policy based on validation flagsnet/netlink/genetlink.c+10 -70 repliesApplied
5/13genetlink: check for callback type at op load timenet/netlink/genetlink.c+10 -100 repliesApplied
6/13genetlink: add policies for both doit and dumpit in ctrl_dumppolicy_start()net/netlink/genetlink.c+38 -100 repliesApplied
7/13genetlink: support split policies in ctrl_dumppolicy_put_op()net/netlink/genetlink.c+33 -220 repliesApplied
8/13genetlink: inline genl_get_cmd()net/netlink/genetlink.c+12 -180 repliesApplied
9/13genetlink: add iterator for walking family opsnet/netlink/genetlink.c+76 -410 repliesApplied
10/13genetlink: use iterator in the op to policy map dumpingnet/netlink/genetlink.c+26 -230 repliesApplied
11/13genetlink: inline old iteration helpersnet/netlink/genetlink.c+9 -230 repliesApplied
12/13genetlink: allow families to use split ops directlyinclude/net/genetlink.h net/netlink/genetlink.c+149 -260 repliesApplied
13/13genetlink: convert control family to split opsnet/netlink/genetlink.c+13 -40 repliesApplied

Reviews trailers per patch

All 13 patches have a Reviewed-by or Acked-by.

PatchJacob KellerJohannes Berg
1/13R-b
2/13R-b R-b
3/13R-b
4/13R-b
5/13R-b
6/13R-b
7/13R-b
8/13R-b
9/13R-b
10/13R-b
11/13R-b
12/13R-b
13/13R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net-next v3 00/13] genetlink: support per op type policies

While writing new genetlink families I was increasingly annoyed by the fact that we don't support different policies for do and dump callbacks. This makes it hard to do proper input validation for dumps which usually have a lot more narrow range of accepted attributes.

There is also a minor inconvenience of not supporting different per_doit and post_doit callbacks per op.

This series addresses those problems by introducing another op format.

v3:
- minor fixes to patch 12 after I took it for a spin with a real family
- adjust commit msg in patch 8
v2: https://lore.kernel.org/all/[email protected]/
- wait for net changes to propagate
- restore the missing comment in patch 1
- drop extra space in patch 3
- improve commit message in patch 4
v1: https://lore.kernel.org/all/[email protected]/

Jakub Kicinski (13):
genetlink: refactor the cmd <> policy mapping dump
genetlink: move the private fields in struct genl_family
genetlink: introduce split op representation
genetlink: load policy based on validation flags
genetlink: check for callback type at op load time
genetlink: add policies for both doit and dumpit in
ctrl_dumppolicy_start()
genetlink: support split policies in ctrl_dumppolicy_put_op()
genetlink: inline genl_get_cmd()
genetlink: add iterator for walking family ops
genetlink: use iterator in the op to policy map dumping
genetlink: inline old iteration helpers
genetlink: allow families to use split ops directly
genetlink: convert control family to split ops

 include/net/genetlink.h   |  76 +++++-
 net/batman-adv/netlink.c  |   6 +-
 net/core/devlink.c        |   4 +-
 net/core/drop_monitor.c   |   4 +-
 net/ieee802154/nl802154.c |   6 +-
 net/netlink/genetlink.c   | 485 ++++++++++++++++++++++++++++----------
 net/wireless/nl80211.c    |   6 +-
 7 files changed, 445 insertions(+), 142 deletions(-)
Signature · 1 line
2.38.1