mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v7 0/2] genetlink: Reject joining multicast groups no family owns
@ 2026-11-16 12:40 Anil Kaushik
  2026-11-16 12:40 ` [PATCH net v7 1/2] " Anil Kaushik
  2026-11-16 12:40 ` [PATCH net v7 2/2] selftests: net: test joining genetlink " Anil Kaushik
  0 siblings, 2 replies; 3+ messages in thread
From: Anil Kaushik @ 2026-11-16 12:40 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, kuba, pabeni, horms, idosch, nicolas.dichtel,
	jacob.e.keller, jiri, fw, martineau, v3rdant.xiang, aliceryhl,
	linux-kernel, nhorman, shuah, linux-kselftest,
	anilkaushikwireless

genl_bind() lets any user join a multicast group ID that no family owns.
A family registered later can get that ID, and the socket stays a member
without a capability check. Patch 1 makes genl_bind() return -ENOENT for
such an ID. Patch 2 adds a selftest for it.

v7:
- Add a selftest as patch 2, as Nicolas asked.
- Say in the comments on the static IDs, and on NET_DM_GRP_ALERT, that
  they can be joined only after the family is registered (Sashiko).
- Say in the commit message that the unregister window was already
  there for the capability check.

v6: https://lore.kernel.org/netdev/20261112094205.1120090-1-anilkaushikwireless@gmail.com/

I used an LLM to help write and review the code, the tests and the
commit messages of this series. I checked and tested every change
myself.

Anil Kaushik (2):
  genetlink: Reject joining multicast groups no family owns
  selftests: net: test joining genetlink groups no family owns

 include/linux/netlink.h                      |   3 +
 include/uapi/linux/net_dropmon.h             |   2 +
 net/netlink/af_netlink.c                     |   6 +
 net/netlink/genetlink.c                      |   5 +-
 tools/testing/selftests/net/Makefile         |   1 +
 tools/testing/selftests/net/nl_genl_mcast.py | 109 +++++++++++++++++++
 6 files changed, 125 insertions(+), 1 deletion(-)
 create mode 100755 tools/testing/selftests/net/nl_genl_mcast.py


base-commit: 070411c1590c8172eb4d86f045d99c372f22fe23
-- 
2.25.1


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

end of thread, other threads:[~2026-11-16 12:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 12:40 [PATCH net v7 0/2] genetlink: Reject joining multicast groups no family owns Anil Kaushik
2026-11-16 12:40 ` [PATCH net v7 1/2] " Anil Kaushik
2026-11-16 12:40 ` [PATCH net v7 2/2] selftests: net: test joining genetlink " Anil Kaushik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®