]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ovpn: use correct array size to parse nested attributes in ovpn_nl_key_swap_doit
authorSabrina Dubroca <sd@queasysnail.net>
Mon, 14 Jul 2025 14:20:02 +0000 (16:20 +0200)
committerAntonio Quartulli <antonio@openvpn.net>
Tue, 17 Mar 2026 10:08:54 +0000 (11:08 +0100)
In ovpn_nl_key_swap_doit, the attributes array used to parse the
OVPN_A_KEYCONF uses OVPN_A_PEER_MAX instead of
OVPN_A_KEYCONF_MAX. Note that this does not cause any bug, since
currently OVPN_A_KEYCONF_MAX < OVPN_A_PEER_MAX.

The wrong constant was introduced by commit 203e2bf55990
("ovpn: implement key add/get/del/swap via netlink")

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
drivers/net/ovpn/netlink.c

index c7f382437630292df56fa90df303135f69e5828e..fed0e46b32a33419df3ba0c24c8ce51de7cfe779 100644 (file)
@@ -1061,8 +1061,8 @@ err:
 
 int ovpn_nl_key_swap_doit(struct sk_buff *skb, struct genl_info *info)
 {
+       struct nlattr *attrs[OVPN_A_KEYCONF_MAX + 1];
        struct ovpn_priv *ovpn = info->user_ptr[0];
-       struct nlattr *attrs[OVPN_A_PEER_MAX + 1];
        struct ovpn_peer *peer;
        u32 peer_id;
        int ret;