]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
geneve: use the correct nlattr array in NL_SET_ERR_MSG_ATTR
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 22 Apr 2020 15:29:51 +0000 (17:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Apr 2020 19:39:09 +0000 (12:39 -0700)
IFLA_GENEVE_* attributes are in the data array, which is correctly
used when fetching the value, but not when setting the extended
ack. Because IFLA_GENEVE_MAX < IFLA_MAX, we avoid out of bounds
array accesses, but we don't provide a pointer to the invalid
attribute to userspace.

Fixes: a025fb5f49ad ("geneve: Allow configuration of DF behaviour")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/geneve.c

index 09f279c0182be4c05144c5caca6548cacfebbd49..6b461be1820bb91899a406032f0dd4dcdb01857e 100644 (file)
@@ -1207,7 +1207,7 @@ static int geneve_validate(struct nlattr *tb[], struct nlattr *data[],
                enum ifla_geneve_df df = nla_get_u8(data[IFLA_GENEVE_DF]);
 
                if (df < 0 || df > GENEVE_DF_MAX) {
-                       NL_SET_ERR_MSG_ATTR(extack, tb[IFLA_GENEVE_DF],
+                       NL_SET_ERR_MSG_ATTR(extack, data[IFLA_GENEVE_DF],
                                            "Invalid DF attribute");
                        return -EINVAL;
                }