summaryrefslogtreecommitdiff
path: root/net/ipv4/esp4_offload.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2020-05-13 13:38:54 +0300
committerSteffen Klassert <steffen.klassert@secunet.com>2020-05-14 13:13:05 +0300
commit56b1b7c667fbb9ee395f7506dfef3c04571e024a (patch)
treee25b7c81135193d183fb3dd87619241eec7a9b92 /net/ipv4/esp4_offload.c
parentc95c5f58b35ef995f66cb55547eee6093ab5fcb8 (diff)
downloadlinux-56b1b7c667fbb9ee395f7506dfef3c04571e024a.tar.xz
esp6: calculate transport_header correctly when sel.family != AF_INET6
In esp6_init_state() for beet mode when x->sel.family != AF_INET6: x->props.header_len = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead) + IPV4_BEET_PHMAXLEN + (sizeof(struct ipv6hdr) - sizeof(struct iphdr)) In xfrm6_beet_gso_segment() skb->transport_header is supposed to move to the end of the ph header for IPPROTO_BEETPH, so if x->sel.family != AF_INET6 and it's IPPROTO_BEETPH, it should do: skb->transport_header -= (sizeof(struct ipv6hdr) - sizeof(struct iphdr)); skb->transport_header += ph->hdrlen * 8; And IPV4_BEET_PHMAXLEN is only reserved for PH header, so if x->sel.family != AF_INET6 and it's not IPPROTO_BEETPH, it should do: skb->transport_header -= (sizeof(struct ipv6hdr) - sizeof(struct iphdr)); skb->transport_header -= IPV4_BEET_PHMAXLEN; Thanks Sabrina for looking deep into this issue. Fixes: 7f9e40eb18a9 ("esp6: add gso_segment for esp6 beet mode") Reported-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv4/esp4_offload.c')
0 files changed, 0 insertions, 0 deletions