net: ip_gre: Accept IFLA_INFO_DATA-less configuration

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>

authored by Petr Machata and committed by David S. Miller 32ca98fe 065fd83e

Changed files
+2
net
ipv4
+2
net/ipv4/ip_gre.c
··· 1168 1168 err = ipgre_netlink_parms(dev, data, tb, parms, fwmark); 1169 1169 if (err) 1170 1170 return err; 1171 + if (!data) 1172 + return 0; 1171 1173 1172 1174 if (data[IFLA_GRE_ERSPAN_VER]) { 1173 1175 t->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]);