提交 0e792e07 编写于 作者: P Petr Machata 提交者: Yang Yingliang

net: ip_gre: Accept IFLA_INFO_DATA-less configuration

stable inclusion
from linux-4.19.114
commit f5ebb2dd86777379a552acce0d635de8210a427c

--------------------------------

[ Upstream commit 32ca98fe ]

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: e1f8f78f ("net: ip_gre: Separate ERSPAN newlink / changelink callbacks")
Reported-by: syzbot+1b4ebf4dae4e510dd219@syzkaller.appspotmail.com
Signed-off-by: NPetr Machata <petrm@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NLi Aichun <liaichun@huawei.com>
Reviewed-by: Nguodeqing <geffrey.guo@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 f79367cf
...@@ -1241,6 +1241,8 @@ static int erspan_netlink_parms(struct net_device *dev, ...@@ -1241,6 +1241,8 @@ static int erspan_netlink_parms(struct net_device *dev,
err = ipgre_netlink_parms(dev, data, tb, parms, fwmark); err = ipgre_netlink_parms(dev, data, tb, parms, fwmark);
if (err) if (err)
return err; return err;
if (!data)
return 0;
if (data[IFLA_GRE_ERSPAN_VER]) { if (data[IFLA_GRE_ERSPAN_VER]) {
t->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]); t->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册