summaryrefslogtreecommitdiffstats
path: root/include/linux/genl_magic_func.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-08-24 17:18:30 -0700
committerDavid S. Miller <davem@davemloft.net>2022-08-29 12:47:15 +0100
commit9c5d03d362519f36cd551aec596388f895c93d2d (patch)
tree5669b75a062436435dc9d4354c668d0f61b7146c /include/linux/genl_magic_func.h
parent53a406803ca5b0b1f91beffacad4321fae4fa2a7 (diff)
downloadlinux-9c5d03d362519f36cd551aec596388f895c93d2d.tar.gz
linux-9c5d03d362519f36cd551aec596388f895c93d2d.tar.bz2
linux-9c5d03d362519f36cd551aec596388f895c93d2d.zip
genetlink: start to validate reserved header bytes
We had historically not checked that genlmsghdr.reserved is 0 on input which prevents us from using those precious bytes in the future. One use case would be to extend the cmd field, which is currently just 8 bits wide and 256 is not a lot of commands for some core families. To make sure that new families do the right thing by default put the onus of opting out of validation on existing families. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Acked-by: Paul Moore <paul@paul-moore.com> (NetLabel) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/genl_magic_func.h')
-rw-r--r--include/linux/genl_magic_func.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h
index 939b1a8f571b..4a4b387181ad 100644
--- a/include/linux/genl_magic_func.h
+++ b/include/linux/genl_magic_func.h
@@ -294,6 +294,7 @@ static struct genl_family ZZZ_genl_family __ro_after_init = {
.ops = ZZZ_genl_ops,
.n_ops = ARRAY_SIZE(ZZZ_genl_ops),
.mcgrps = ZZZ_genl_mcgrps,
+ .resv_start_op = 42, /* drbd is currently the only user */
.n_mcgrps = ARRAY_SIZE(ZZZ_genl_mcgrps),
.module = THIS_MODULE,
};