summaryrefslogtreecommitdiffstats
path: root/drivers/net/vxlan.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2017-06-27 14:42:43 +0200
committerDavid S. Miller <davem@davemloft.net>2017-06-27 14:40:35 -0400
commit019b13ae85260cfab9d7ccb6ca58f094d18a24fd (patch)
tree090b93abb8ec16bcc299e0db8fe7b912460ade61 /drivers/net/vxlan.c
parentc017ce0a9ad753e3835d7f8f5fca89960380e816 (diff)
downloadlinux-019b13ae85260cfab9d7ccb6ca58f094d18a24fd.tar.gz
linux-019b13ae85260cfab9d7ccb6ca58f094d18a24fd.tar.bz2
linux-019b13ae85260cfab9d7ccb6ca58f094d18a24fd.zip
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: a985343ba906 "vxlan: refactor verification and application of configuration" Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r--drivers/net/vxlan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 0dafd8e6c665..fd0ff97e3d81 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2727,7 +2727,7 @@ static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[],
}
if (tb[IFLA_MTU]) {
- u32 mtu = nla_get_u32(data[IFLA_MTU]);
+ u32 mtu = nla_get_u32(tb[IFLA_MTU]);
if (mtu < ETH_MIN_MTU || mtu > ETH_MAX_MTU)
return -EINVAL;