]> git.baikalelectronics.ru Git - kernel.git/commit
genetlink: reject use of nlmsg_flags for new commands
authorJakub Kicinski <kuba@kernel.org>
Thu, 29 Sep 2022 14:28:09 +0000 (07:28 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 1 Oct 2022 00:43:09 +0000 (17:43 -0700)
commit6c94272db0769dff5f27189baa813eb81150f951
treee86e6a63dfb3a73cfd8ede815601e719044c51f8
parent46d5392b7cbfe25d5cfc68f7176728551031f08c
genetlink: reject use of nlmsg_flags for new commands

Commit b1055b871676 ("genetlink: start to validate reserved header bytes")
introduced extra validation for genetlink headers. We had to gate it
to only apply to new commands, to maintain bug-wards compatibility.
Use this opportunity (before the new checks make it to Linus's tree)
to add more conditions.

Validate that Generic Netlink families do not use nlmsg_flags outside
of the well-understood set.

Link: https://lore.kernel.org/all/20220928073709.1b93b74a@kernel.org/
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20220929142809.1167546-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/netlink/genetlink.c