ipv6: sr: clear IP6CB(skb) on SRH ip4ip6 encapsulation
authorYohei Kanemaru <yohei.kanemaru@gmail.com>
Tue, 29 Jan 2019 06:52:34 +0000 (15:52 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Feb 2019 16:31:31 +0000 (17:31 +0100)
commitc630ec8bdadae9d557b1ceb9d6c06e149108a0d4
treed17f0479161b96a8a12925a6a07286233da1089b
parentb99abc70ea8f79fda83f8a795cbc717c47311ae8
ipv6: sr: clear IP6CB(skb) on SRH ip4ip6 encapsulation

[ Upstream commit ef489749aae508e6f17886775c075f12ff919fb1 ]

skb->cb may contain data from previous layers (in an observed case
IPv4 with L3 Master Device). In the observed scenario, the data in
IPCB(skb)->frags was misinterpreted as IP6CB(skb)->frag_max_size,
eventually caused an unexpected IPv6 fragmentation in ip6_fragment()
through ip6_finish_output().

This patch clears IP6CB(skb), which potentially contains garbage data,
on the SRH ip4ip6 encapsulation.

Fixes: 32d99d0b6702 ("ipv6: sr: add support for ip4ip6 encapsulation")
Signed-off-by: Yohei Kanemaru <yohei.kanemaru@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/seg6_iptunnel.c