Skip to content

genetlink: apply reject policy for split ops on the dispatch path

Jakub Kicinski linux-kselftest netdev 2 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 1 replyApplied 4/4
  2. v12 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- add patch 1 to avoid breaking devlink
- add a lot more tests
v1: https://lore.kernel.org/[email protected]

Patches in v2 All 4 applied

#Subject and filesSizeRepliesApplied
1/4genetlink: use maxattr of 0 for the reject policynet/netlink/genetlink.c net/netlink/policy.c+11 -120 repliesApplied
2/4genetlink: apply reject policy for split ops on the dispatch pathnet/netlink/genetlink.c+1 -00 repliesApplied
3/4selftests: net: make sure that Netlink rejects unknown attrs in dumptools/testing/selftests/net/nl_netdev.py+26 -60 repliesApplied
4/4selftests: net: add test for Netlink policy dumpstools/testing/selftests/net/Makefile tools/testing/selftests/net/lib/py/__init__.py tools/testing/selftests/net/lib/py/ynl.py +1 more+148 -30 repliesApplied

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH net-next v2 0/4] genetlink: apply reject policy for split ops on the dispatch path

Looks like I somehow missed adding default reject policies to commands in families using split Netlink ops. I realized this randomly trying to dump page pools for a specific device and always getting all of them back. The per-device dump is simply not implemented so the request should have been rejected. Patch 2 is the real change, the rest is just accompaniment.

v2:
- add patch 1 to avoid breaking devlink
- add a lot more tests
v1: https://lore.kernel.org/[email protected]

Jakub Kicinski (4):
genetlink: use maxattr of 0 for the reject policy
genetlink: apply reject policy for split ops on the dispatch path
selftests: net: make sure that Netlink rejects unknown attrs in dump
selftests: net: add test for Netlink policy dumps

 tools/testing/selftests/net/Makefile          |   1 +
 net/netlink/genetlink.c                       |  20 +--
 net/netlink/policy.c                          |   4 +-
 .../testing/selftests/net/lib/py/__init__.py  |   5 +-
 tools/testing/selftests/net/lib/py/ynl.py     |  10 +-
 tools/testing/selftests/net/nl_netdev.py      |  32 ++++-
 tools/testing/selftests/net/nl_nlctrl.py      | 135 ++++++++++++++++++
 7 files changed, 186 insertions(+), 21 deletions(-)
 create mode 100755 tools/testing/selftests/net/nl_nlctrl.py
Signature · 1 line
2.53.0