summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2020-03-16 19:53:00 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-02 15:28:13 +0200
commitf5ebb2dd86777379a552acce0d635de8210a427c (patch)
treef09823c00a8e8cd3ed63bba15733f6fd218c78f4 /net/ipv4
parent54266b2694682e7207ec66bce59f4f5323727dd3 (diff)
downloadlinux-stable-f5ebb2dd86777379a552acce0d635de8210a427c.tar.gz
linux-stable-f5ebb2dd86777379a552acce0d635de8210a427c.tar.bz2
linux-stable-f5ebb2dd86777379a552acce0d635de8210a427c.zip
net: ip_gre: Accept IFLA_INFO_DATA-less configuration
[ Upstream commit 32ca98feab8c9076c89c0697c5a85e46fece809d ] The fix referenced below causes a crash when an ERSPAN tunnel is created without passing IFLA_INFO_DATA. Fix by validating passed-in data in the same way as ipgre does. Fixes: e1f8f78ffe98 ("net: ip_gre: Separate ERSPAN newlink / changelink callbacks") Reported-by: syzbot+1b4ebf4dae4e510dd219@syzkaller.appspotmail.com Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ip_gre.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 26dfcf605ec5..ffcb5983107d 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1241,6 +1241,8 @@ static int erspan_netlink_parms(struct net_device *dev,
err = ipgre_netlink_parms(dev, data, tb, parms, fwmark);
if (err)
return err;
+ if (!data)
+ return 0;
if (data[IFLA_GRE_ERSPAN_VER]) {
t->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]);