]> git.baikalelectronics.ru Git - kernel.git/commit
erspan: fix the tun_info options_len check for erspan
authorXin Long <lucien.xin@gmail.com>
Mon, 28 Oct 2019 15:19:35 +0000 (23:19 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Oct 2019 00:36:42 +0000 (17:36 -0700)
commit37cec0c5c5578a292d80d7e48414c00ced4b12ec
tree5490ad73490d3235a4da373fe744a0a9f8087951
parent690ca5380be6f2877cbf80eb4106978bf846c8d0
erspan: fix the tun_info options_len check for erspan

The check for !md doens't really work for ip_tunnel_info_opts(info) which
only does info + 1. Also to avoid out-of-bounds access on info, it should
ensure options_len is not less than erspan_metadata in both erspan_xmit()
and ip6erspan_tunnel_xmit().

Fixes: 575e645431 ("gre: add collect_md mode to ERSPAN tunnel")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_gre.c
net/ipv6/ip6_gre.c