Repository : ssh://git@diktynna/batman-adv
On branch : master
commit e8b0836b9660b18e9be8be13e53e44768ae9761d Author: Jakub Kicinski kuba@kernel.org Date: Wed Aug 24 17:18:30 2022 -0700
batman-adv: 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 [sven@narfation.org: Add compat code] Signed-off-by: Sven Eckelmann sven@narfation.org
e8b0836b9660b18e9be8be13e53e44768ae9761d net/batman-adv/netlink.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c index 00875e1d..63253d4a 100644 --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c @@ -1493,6 +1493,9 @@ struct genl_family batadv_netlink_family __ro_after_init = { .module = THIS_MODULE, .small_ops = batadv_netlink_ops, .n_small_ops = ARRAY_SIZE(batadv_netlink_ops), +#if LINUX_VERSION_IS_GEQ(6, 1, 0) // UGLY_HACK_NEW + .resv_start_op = BATADV_CMD_SET_VLAN + 1, +#endif // UGLY_HACK_STOP .mcgrps = batadv_netlink_mcgrps, .n_mcgrps = ARRAY_SIZE(batadv_netlink_mcgrps), };