net: ip_gre: Accept IFLA_INFO_DATA-less configuration
authorPetr Machata <petrm@mellanox.com>
Mon, 16 Mar 2020 17:53:00 +0000 (19:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 09:01:46 +0000 (11:01 +0200)
commite4723e0a858e6ba960c42c5df835e851a49ba1f6
treef1c5f88b92f81f8d353c1c3ee596d27298930f99
parent85aa84d3c5877ee999546729892ae6c5dbaeac3c
net: ip_gre: Accept IFLA_INFO_DATA-less configuration

[ Upstream commit 32ca98feab8c9076c89c0697c5a85e46fece809d ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/ip_gre.c