Skip to content

Commit 019b13a

Browse files
neocturnedavem330
authored andcommitted
vxlan: fix incorrect nlattr access in MTU check
The access to the wrong variable could lead to a NULL dereference and possibly other invalid memory reads in vxlan newlink/changelink requests with a IFLA_MTU attribute. Fixes: a985343 "vxlan: refactor verification and application of configuration" Signed-off-by: Matthias Schiffer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c017ce0 commit 019b13a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/vxlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2727,7 +2727,7 @@ static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[],
27272727
}
27282728

27292729
if (tb[IFLA_MTU]) {
2730-
u32 mtu = nla_get_u32(data[IFLA_MTU]);
2730+
u32 mtu = nla_get_u32(tb[IFLA_MTU]);
27312731

27322732
if (mtu < ETH_MIN_MTU || mtu > ETH_MAX_MTU)
27332733
return -EINVAL;

0 commit comments

Comments
 (0)