diff options
| author | Omar Ramadan <omar@blockcast.net> | 2026-09-28 21:15:57 +0300 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-10-01 13:07:34 +0200 |
| commit | eb0c18404c8943356f4aa164e5db9067b79ea93c (patch) | |
| tree | 6a462862f30e790ff0c962121361c43fd836f3d4 /scripts | |
| parent | f9cb4d296d81adb0923546ca5d54fae57a81af52 (diff) | |
amt: pull the AMT header behind the transport header in amt_parse_type()
A gateway's encap socket passes ICMP errors to amt_err_lookup(), which
calls amt_parse_type() on the quoted datagram to see which AMT message
failed. On that path skb->data points at the quoted IP header and the
transport header at the quoted UDP header, and icmp_socket_deliver()
only guarantees the quoted IP header plus 8 bytes, that is, up to the
end of the UDP header.
amt_parse_type() pulls sizeof(struct udphdr) + sizeof(struct amt_header)
bytes from skb->data, which on this path stays inside the quoted IP
header, and then reads the AMT header behind udp_hdr(skb). An ICMP error
that quotes only the IP and UDP headers of a Request, the minimum RFC 792
asks for, therefore makes it read past the pulled data, and past the end
of the packet when nothing follows.
Pull up to the transport header plus the UDP and AMT headers, as
vxlan_err_lookup() does. amt_rcv() is called with the transport header
at skb->data, so the pull on the receive path does not change.
Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface")
Signed-off-by: Omar Ramadan <omar@blockcast.net>
Reviewed-by: Eric Dumazet <edumazet@@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20260928181557.85796-1-omar@blockcast.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
