diff options
| author | Petr Machata <[email protected]> | 2020-03-16 17:53:00 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2020-03-17 00:19:56 +0000 |
| commit | 32ca98feab8c9076c89c0697c5a85e46fece809d (patch) | |
| tree | 248d64fff9e080d57e52b46436af66155a5f0a6f | |
| parent | net: mvneta: Fix the case where the last poll did not process all rx (diff) | |
| download | kernel-32ca98feab8c9076c89c0697c5a85e46fece809d.tar.gz kernel-32ca98feab8c9076c89c0697c5a85e46fece809d.zip | |
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: [email protected]
Signed-off-by: Petr Machata <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
| -rw-r--r-- | net/ipv4/ip_gre.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 7765c65fc7d2..029b24eeafba 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -1168,6 +1168,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]); |
