Skip to content

Commit 9a7b5b5

Browse files
qsndavem330
authored andcommitted
geneve: use the correct nlattr array in NL_SET_ERR_MSG_ATTR
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: a025fb5 ("geneve: Allow configuration of DF behaviour") Signed-off-by: Sabrina Dubroca <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cc8e7c6 commit 9a7b5b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/geneve.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ static int geneve_validate(struct nlattr *tb[], struct nlattr *data[],
12071207
enum ifla_geneve_df df = nla_get_u8(data[IFLA_GENEVE_DF]);
12081208

12091209
if (df < 0 || df > GENEVE_DF_MAX) {
1210-
NL_SET_ERR_MSG_ATTR(extack, tb[IFLA_GENEVE_DF],
1210+
NL_SET_ERR_MSG_ATTR(extack, data[IFLA_GENEVE_DF],
12111211
"Invalid DF attribute");
12121212
return -EINVAL;
12131213
}

0 commit comments

Comments
 (0)