genetlink: add explicit ordering break check for split ops
authorJiri Pirko <jiri@nvidia.com>
Thu, 20 Jul 2023 11:13:54 +0000 (13:13 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 22 Jul 2023 01:49:12 +0000 (18:49 -0700)
commit5766946ea5117e4edeb78c80cac367fb06854cc1
tree2872d4031495f4056009058d76b2f1b95a4d8000
parent070e8bd31b288c3aa3f965778417708c8bfedb06
genetlink: add explicit ordering break check for split ops

Currently, if cmd in the split ops array is of lower value than the
previous one, genl_validate_ops() continues to do the checks as if
the values are equal. This may result in non-obvious WARN_ON() hit in
these check.

Instead, check the incorrect ordering explicitly and put a WARN_ON()
in case it is broken.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20230720111354.562242-1-jiri@resnulli.us
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/netlink/genetlink.c