public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] genetlink: apply reject policy for split ops on the dispatch path
@ 2026-03-07 20:44 Jakub Kicinski
  2026-03-07 20:44 ` [PATCH net-next 2/2] selftests: net: make sure that Netlink rejects unknown attrs in dump Jakub Kicinski
  2026-03-08 13:19 ` [syzbot ci] Re: genetlink: apply reject policy for split ops on the dispatch path syzbot ci
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2026-03-07 20:44 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, andrew+netdev, horms, Jakub Kicinski,
	kees, alok.a.tiwari

Commit 4fa86555d1cd ("genetlink: piggy back on resv_op to default to
a reject policy") added genl_policy_reject_all to ensure that ops
without an explicit policy reject all attributes rather than silently
accepting them. This change was applied to net.

When split ops were later introduced in net-next in
commit b8fd60c36a44 ("genetlink: allow families to use split ops directly"),
genl_op_fill_in_reject_policy_split() was added and called from
genl_op_from_split() (used for policy dumping and registration).
However, genl_get_cmd_split(), which is called for incoming messages,
copies split_ops entries as-is without applying the reject policy.
This means that split ops without policy accept all inputs.

This looks like an omission / mistake made when splitting the changes
between net and net-next. Let's try to re-introduce the checking.
Not considering this a fix given the regression potential.
If anyone reports issues we should probably fill in fake policies
for specific ops rather than reverting this.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: kees@kernel.org
CC: alok.a.tiwari@oracle.com
---
 net/netlink/genetlink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index a23d4c51c089..656d32046147 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -250,6 +250,7 @@ genl_get_cmd_split(u32 cmd, u8 flag, const struct genl_family *family,
 		if (family->split_ops[i].cmd == cmd &&
 		    family->split_ops[i].flags & flag) {
 			*op = family->split_ops[i];
+			genl_op_fill_in_reject_policy_split(family, op);
 			return 0;
 		}
 
-- 
2.53.0


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

end of thread, other threads:[~2026-03-08 13:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-07 20:44 [PATCH net-next 1/2] genetlink: apply reject policy for split ops on the dispatch path Jakub Kicinski
2026-03-07 20:44 ` [PATCH net-next 2/2] selftests: net: make sure that Netlink rejects unknown attrs in dump Jakub Kicinski
2026-03-08 13:19 ` [syzbot ci] Re: genetlink: apply reject policy for split ops on the dispatch path syzbot ci

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