[PATCH v2 0/2] udp: Fix some minor warts in the ICMP error propagation code
While working on using connected sockets for both sides of UDP flows, I spotted a couple of minor problems in the recently added ICMP error propagation code. Here are the fixes. v2: * Rebase and fix conflict with Jon's recent fix in the same code David Gibson (2): udp: Don't attempt to forward ICMP socket errors to other sockets udp: Improve name of UDP related ICMP sending functions udp.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) -- 2.49.0
Recently we added support for detecting ICMP triggered errors on UDP
sockets and forwarding them to the tap interface. However, in
udp_sock_recverr() where this is handled we don't know for certain that
the tap interface is the other side of the UDP flow. It could be a spliced
connection with another socket on the other side.
To forward errors in that case, we'd need to force the other side's socket
to trigger issue an ICMP error. I'm not sure if there's a way to do that;
probably not for an arbitrary ICMP but it might be possible for certain
error conditions.
Nonetheless what we do now - synthesise an ICMP on the tap interface - is
certainly wrong. It's probably harmless; for a spliced connection it will
have loopback addresses meaning we can expect the guest to discard it.
But, correct this for now, by not attempting to propagate errors when the
other side of the flow is a socket.
Fixes: 55431f007 ("udp: create and send ICMPv4 to local peer when...")
Fixes: 68b04182e ("udp: create and send ICMPv6 to local peer when...")
Signed-off-by: David Gibson
udp_send_conn_fail_icmp[46]() aren't actually specific to connections
failing: they can propagate a variety of ICMP errors, which might or might
not break a "connection". They are, however, specific to sending ICMP
errors to the tap connection, not splice or host. Rename them to better
reflect that.
Signed-off-by: David Gibson
On Fri, 28 Mar 2025 14:34:13 +1100
David Gibson
While working on using connected sockets for both sides of UDP flows, I spotted a couple of minor problems in the recently added ICMP error propagation code. Here are the fixes.
v2: * Rebase and fix conflict with Jon's recent fix in the same code
David Gibson (2): udp: Don't attempt to forward ICMP socket errors to other sockets udp: Improve name of UDP related ICMP sending functions
Applied. -- Stefano
participants (2)
-
David Gibson
-
Stefano Brivio