Skip to content

Commit d5dba13

Browse files
qsnklassert
authored andcommitted
xfrm: esp6: fix the location of the transport header with encapsulation
commit 17175d1 ("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: 0146dca ("xfrm: add support for UDPv6 encapsulation of ESP") Fixes: 26333c3 ("xfrm: add IPv6 support for espintcp") Reported-by: Xiumei Mu <[email protected]> Signed-off-by: Sabrina Dubroca <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 37bd224 commit d5dba13

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv6/esp6.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,7 @@ int esp6_input_done2(struct sk_buff *skb, int err)
815815
offset = ipv6_skip_exthdr(skb, offset, &nexthdr, &frag_off);
816816
uh = (void *)(skb->data + offset);
817817
th = (void *)(skb->data + offset);
818+
hdr_len += offset;
818819

819820
switch (x->encap->encap_type) {
820821
case TCP_ENCAP_ESPINTCP:

0 commit comments

Comments
 (0)