summaryrefslogtreecommitdiff
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
commitbc5287dc4dba371ad011b57f6168b11b4e3b4361 (patch)
tree646075c86ad2346cc970da311e3d230ad8aa7306
parentc89ecb77bf76305e5fcdf03d2c66aab28dd70885 (diff)
downloadwireguard-linux-trimmed-bc5287dc4dba371ad011b57f6168b11b4e3b4361.tar.gz
wireguard-linux-trimmed-bc5287dc4dba371ad011b57f6168b11b4e3b4361.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>
-rw-r--r--drivers/net/wireguard/netlink.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireguard/netlink.c b/drivers/net/wireguard/netlink.c
index d0f3b6d..0c0644e 100644
--- a/drivers/net/wireguard/netlink.c
+++ b/drivers/net/wireguard/netlink.c
@@ -621,6 +621,7 @@ static const struct genl_ops genl_ops[] = {
static struct genl_family genl_family __ro_after_init = {
.ops = genl_ops,
.n_ops = ARRAY_SIZE(genl_ops),
+ .resv_start_op = WG_CMD_SET_DEVICE + 1,
.name = WG_GENL_NAME,
.version = WG_GENL_VERSION,
.maxattr = WGDEVICE_A_MAX,