]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
genetlink: apply reject policy for split ops on the dispatch path
authorJakub Kicinski <kuba@kernel.org>
Wed, 11 Mar 2026 03:28:37 +0000 (20:28 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 13 Mar 2026 01:02:13 +0000 (18:02 -0700)
commite3a5b7f8ef2abe7b119c1806ee214d648289faf6
treea180596955b494897b42caf771d06aa91b141751
parentb93ec16310b4bfc14af12321257dd7237ef4cce9
genetlink: apply reject policy for split ops on the dispatch path

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.

Link: https://patch.msgid.link/20260311032839.417748-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/netlink/genetlink.c