]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
rxrpc: Fix ICMP/ICMP6 error handling
authorDavid Howells <dhowells@redhat.com>
Fri, 26 Aug 2022 14:39:28 +0000 (15:39 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 Nov 2022 14:11:11 +0000 (15:11 +0100)
commit83cafb2a316a397b5eb250cab6995788e7b66219
tree3f50656fb5ed9d4b2f351ff5a7cd8758fe1a9793
parent54430852996e696c0d5f295a93391e16e40ecedd
rxrpc: Fix ICMP/ICMP6 error handling

BugLink: https://bugs.launchpad.net/bugs/1993003
[ Upstream commit ac56a0b48da86fd1b4389632fb7c4c8a5d86eefa ]

Because rxrpc pretends to be a tunnel on top of a UDP/UDP6 socket, allowing
it to siphon off UDP packets early in the handling of received UDP packets
thereby avoiding the packet going through the UDP receive queue, it doesn't
get ICMP packets through the UDP ->sk_error_report() callback.  In fact, it
doesn't appear that there's any usable option for getting hold of ICMP
packets.

Fix this by adding a new UDP encap hook to distribute error messages for
UDP tunnels.  If the hook is set, then the tunnel driver will be able to
see ICMP packets.  The hook provides the offset into the packet of the UDP
header of the original packet that caused the notification.

An alternative would be to call the ->error_handler() hook - but that
requires that the skbuff be cloned (as ip_icmp_error() or ipv6_cmp_error()
do, though isn't really necessary or desirable in rxrpc's case is we want
to parse them there and then, not queue them).

Changes
=======
ver #3)
 - Fixed an uninitialised variable.

ver #2)
 - Fixed some missing CONFIG_AF_RXRPC_IPV6 conditionals.

Fixes: 5271953cad31 ("rxrpc: Use the UDP encap_rcv hook")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/linux/udp.h
include/net/udp_tunnel.h
net/ipv4/udp.c
net/ipv4/udp_tunnel_core.c
net/ipv6/udp.c
net/rxrpc/ar-internal.h
net/rxrpc/local_object.c
net/rxrpc/peer_event.c