]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
tunnel: Clear IPCB(skb)->opt before dst_link_failure called
authorBernie Harris <bernie.harris@alliedtelesis.co.nz>
Sun, 21 Feb 2016 23:58:05 +0000 (12:58 +1300)
committerTim Gardner <tim.gardner@canonical.com>
Thu, 21 Apr 2016 13:20:24 +0000 (07:20 -0600)
commit9e683c5356e854230962abe68df76346dff1118a
tree543985fc2eec9714f79658f3602b9aa544465fba
parent97bbdd414a5f3a7b4e8c29c525da188169937c70
tunnel: Clear IPCB(skb)->opt before dst_link_failure called

BugLink: http://bugs.launchpad.net/bugs/1573034
[ Upstream commit 5146d1f151122e868e594c7b45115d64825aee5f ]

IPCB may contain data from previous layers (in the observed case the
qdisc layer). In the observed scenario, the data was misinterpreted as
ip header options, which later caused the ihl to be set to an invalid
value (<5). This resulted in an infinite loop in the mips implementation
of ip_fast_csum.

This patch clears IPCB(skb)->opt before dst_link_failure can be called for
various types of tunnels. This change only applies to encapsulated ipv4
packets.

The code introduced in 11c21a30 which clears all of IPCB has been removed
to be consistent with these changes, and instead the opt field is cleared
unconditionally in ip_tunnel_xmit. The change in ip_tunnel_xmit applies to
SIT, GRE, and IPIP tunnels.

The relevant vti, l2tp, and pptp functions already contain similar code for
clearing the IPCB.

Signed-off-by: Bernie Harris <bernie.harris@alliedtelesis.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
net/ipv4/ip_tunnel.c
net/ipv4/udp_tunnel.c
net/ipv6/ip6_gre.c
net/ipv6/ip6_tunnel.c