mbox series

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

Message ID 20221104191343.690543-1-kuba@kernel.org (mailing list archive)
Headers show
Series genetlink: support per op type policies | expand

Message

Jakub Kicinski Nov. 4, 2022, 7:13 p.m. UTC
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/20221102213338.194672-1-kuba@kernel.org/
 - 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/20221018230728.1039524-1-kuba@kernel.org/

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

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 7, 2022, 12:50 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri,  4 Nov 2022 12:13:30 -0700 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next,v3,01/13] genetlink: refactor the cmd <> policy mapping dump
    https://git.kernel.org/netdev/net-next/c/ff14adbd8779
  - [net-next,v3,02/13] genetlink: move the private fields in struct genl_family
    https://git.kernel.org/netdev/net-next/c/7c3eaa022261
  - [net-next,v3,03/13] genetlink: introduce split op representation
    https://git.kernel.org/netdev/net-next/c/20b0b53aca43
  - [net-next,v3,04/13] genetlink: load policy based on validation flags
    https://git.kernel.org/netdev/net-next/c/7747eb75f618
  - [net-next,v3,05/13] genetlink: check for callback type at op load time
    https://git.kernel.org/netdev/net-next/c/e1a248911d06
  - [net-next,v3,06/13] genetlink: add policies for both doit and dumpit in ctrl_dumppolicy_start()
    https://git.kernel.org/netdev/net-next/c/92d3d9ba9bb3
  - [net-next,v3,07/13] genetlink: support split policies in ctrl_dumppolicy_put_op()
    https://git.kernel.org/netdev/net-next/c/26588edbef60
  - [net-next,v3,08/13] genetlink: inline genl_get_cmd()
    https://git.kernel.org/netdev/net-next/c/8d84322ae6d7
  - [net-next,v3,09/13] genetlink: add iterator for walking family ops
    https://git.kernel.org/netdev/net-next/c/6557461cd278
  - [net-next,v3,10/13] genetlink: use iterator in the op to policy map dumping
    https://git.kernel.org/netdev/net-next/c/b502b3185cd6
  - [net-next,v3,11/13] genetlink: inline old iteration helpers
    https://git.kernel.org/netdev/net-next/c/7acfbbe17c18
  - [net-next,v3,12/13] genetlink: allow families to use split ops directly
    https://git.kernel.org/netdev/net-next/c/b8fd60c36a44
  - [net-next,v3,13/13] genetlink: convert control family to split ops
    https://git.kernel.org/netdev/net-next/c/aba22ca8ccd6

You are awesome, thank you!