* [PATCH net] net: ip_gre: Accept IFLA_INFO_DATA-less configuration
@ 2020-03-16 17:53 Petr Machata
2020-03-17 0:21 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Petr Machata @ 2020-03-16 17:53 UTC (permalink / raw)
To: netdev
Cc: Petr Machata, William Tu, Xin Long, David S . Miller, kuznet,
syzkaller-bugs, yoshfuji, syzbot+1b4ebf4dae4e510dd219
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>
---
net/ipv4/ip_gre.c | 2 ++
1 file changed, 2 insertions(+)
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]);
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: ip_gre: Accept IFLA_INFO_DATA-less configuration
2020-03-16 17:53 [PATCH net] net: ip_gre: Accept IFLA_INFO_DATA-less configuration Petr Machata
@ 2020-03-17 0:21 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-03-17 0:21 UTC (permalink / raw)
To: petrm
Cc: netdev, u9012063, lucien.xin, kuznet, syzkaller-bugs, yoshfuji,
syzbot+1b4ebf4dae4e510dd219
From: Petr Machata <petrm@mellanox.com>
Date: Mon, 16 Mar 2020 19:53:00 +0200
> 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>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-17 0:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16 17:53 [PATCH net] net: ip_gre: Accept IFLA_INFO_DATA-less configuration Petr Machata
2020-03-17 0:21 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).