Skip to content

Commit 32ca98f

Browse files
pmachatadavem330
authored andcommitted
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: e1f8f78 ("net: ip_gre: Separate ERSPAN newlink / changelink callbacks") Reported-by: [email protected] Signed-off-by: Petr Machata <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 065fd83 commit 32ca98f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv4/ip_gre.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,8 @@ static int erspan_netlink_parms(struct net_device *dev,
11681168
err = ipgre_netlink_parms(dev, data, tb, parms, fwmark);
11691169
if (err)
11701170
return err;
1171+
if (!data)
1172+
return 0;
11711173

11721174
if (data[IFLA_GRE_ERSPAN_VER]) {
11731175
t->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]);

0 commit comments

Comments
 (0)