]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: esp6: fix the location of the transport header with encapsulation
authorSabrina Dubroca <sd@queasysnail.net>
Mon, 27 Jul 2020 14:03:47 +0000 (16:03 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Tue, 28 Jul 2020 05:57:23 +0000 (07:57 +0200)
commit5e1f00f94827e0a20d9321401a372595f26b47f5
tree40cdcec327da46d657fe6953886ddab61ff373c6
parent1a7b3b0153a881fa28ec2844c0435ebe8268fd2a
xfrm: esp6: fix the location of the transport header with encapsulation

commit 52a73877f170 ("xfrm: esp6: fix encapsulation header offset
computation") changed esp6_input_done2 to correctly find the size of
the IPv6 header that precedes the TCP/UDP encapsulation header, but
didn't adjust the final call to skb_set_transport_header, which I
assumed was correct in using skb_network_header_len.

Xiumei Mu reported that when we create xfrm states that include port
numbers in the selector, traffic from the user sockets is dropped. It
turns out that we get a state mismatch in __xfrm_policy_check, because
we end up trying to compare the encapsulation header's ports with the
selector that's based on user traffic ports.

Fixes: 7cb6b7642922 ("xfrm: add support for UDPv6 encapsulation of ESP")
Fixes: 222ede663194 ("xfrm: add IPv6 support for espintcp")
Reported-by: Xiumei Mu <xmu@redhat.com>
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv6/esp6.c