Article View: linux.kernel.netdev
Article #23864Re: [PATCH net] udp: don't apply socketless ICMP PMTU/redirect updates on end hosts
From: Tom
Date: Sat, 28 Nov 2026 12:54
Date: Sat, 28 Nov 2026 12:54
98 lines
13754 bytes
13754 bytes
Hello Ido,
> This is intentional. See commit 4c3499f79f8c ("ipv4: udp: Create
> exceptions before socket matching") and commit ac76cab50e89 ("ipv6: udp:
> Create exceptions before socket matching").
Thank you for the review and for pointing me to commits 4c3499f79f8c and
ac76cab50e89.
> If exceptions are only created when the quoted packet matches a socket,
> then an off-path attacker can probe the exception cache to discover the
> ephemeral port of a connected UDP socket. This patch reintroduces this
> side channel on every host with forwarding disabled and breaks
> tools/testing/selftests/net/exception_cache.sh.
How could an off-path attacker probe the FNHE cache to discover the
ephemeral port of a connected UDP socket? Prior to ac76cab and
ac76cab50e89.
Thanks.
Best regards,
Tomas
Il giorno gio 26 nov 2026 alle ore 09:04 Ido Schimmel
<idosch@nvidia.com> ha scritto:
>
> On Thu, Nov 26, 2026 at 01:31:05AM +0100, Tom wrote:
> > ICMP error messages are unauthenticated and quote an attacker-chosen
> > inner header. udp_err_update_exception() (and its IPv6 twin
> > udpv6_err_update_exception()) process ICMP Destination Unreachable
> > messages with Code 4 (fragmentation needed, RFC 792) and ICMP Redirect
> > messages before any socket lookup, calling ipv4_update_pmtu() /
> > ipv4_redirect() with no socket and oif = 0.
>
> This is intentional. See commit 4c3499f79f8c ("ipv4: udp: Create
> exceptions before socket matching") and commit ac76cab50e89 ("ipv6: udp:
> Create exceptions before socket matching").
>
> If exceptions are only created when the quoted packet matches a socket,
> then an off-path attacker can probe the exception cache to discover the
> ephemeral port of a connected UDP socket. This patch reintroduces this
> side channel on every host with forwarding disabled and breaks
> tools/testing/selftests/net/exception_cache.sh.
>
> > The resulting change is stored in a route entry's PMTU, which every
> > user of that route shares; on a non-forwarding end host with one route
> > to the internet, the change affects the entire network namespace.
>
> The exception is created for the quoted destination address and only
> affects traffic towards it.
>
> [...]
>
> > values below net.ipv4.ip_rt_min_pmtu are clamped and locked (see
> > __ip_rt_update_pmtu()), so a locked 552-byte PMTU persists until a
> > route flush
>
> No. They expire after net.ipv4.route.mtu_expires like other exceptions.
>
> [...]
>
> > The in-kernel ICMP rate limit exempts fragmentation-needed errors from
> > its ratemask, so attacker-controlled entries can be refreshed
> > unthrottled.
>
> ?
>
> These rate limits are for locally generated ICMP packets, not received
> ones.
>
> >
> > TCP drops errors for packets that match no socket (tcp_v4_err(),
> > net/ipv4/tcp_ipv4.c); UDP should not be more trusting than TCP on end
> > hosts, where forwarded flows do not exist: an error that matches no
> > socket would then change no route state at all.
>
> The exception cache doesn't care about L4. ICMP errors that quote ICMP
> packets can already update the cache with no validation and the
> validation is minimal when the inner packet matches an unconnected UDP
> socket. This is all explained in the commits I mentioned.
>
> > Fix this by only performing socketless PMTU/redirect updates where they
> > are actually required -- for forwarded traffic on a router
> > (net.ipv4.ip_forward enabled on IPv4, net.ipv6.conf.all.forwarding on
> > IPv6).
>
> ICMP errors about forwarded traffic are sent to the originator of the
> quoted packet. The router forwards them and they never reach udp_err().
> The forwarding sysctl is irrelevant here.
Technical Details
Message-ID:
<CAAHj5qj6fcr0td6uz=8yHnnmuuf2j0_1qdL5kto4O1eHT3XCmQ@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373120-linux-kernel-netdev=dewy.ruReferences:
<CAAHj5qjM7BoGKD35gVCn_XCf6ec-LKq7-5_1YMewOYfskyATjQ@mail.gmail.com> <20261126080401.GA540848@shredder>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373120-linux-kernel-netdev=dewy.ru
From: tomasbortoli@gmail.com (Tom)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] udp: don't apply socketless ICMP PMTU/redirect
updates on end hosts
Date: Sat, 28 Nov 2026 13:54:20 +0100
Organization: Usenet Network
Message-ID: <CAAHj5qj6fcr0td6uz=8yHnnmuuf2j0_1qdL5kto4O1eHT3XCmQ@mail.gmail.com>
References: <CAAHj5qjM7BoGKD35gVCn_XCf6ec-LKq7-5_1YMewOYfskyATjQ@mail.gmail.com>
<20261126080401.GA540848@shredder>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: usenet.network;
logging-data="950292"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/O5ZQ84WnK/JyPGCOrZA8Grf/UU= sha256:3Iniy2sVtcxrk9HfdvfIbvXaSZEyZ0IHUjfGlwq2JJc=
sha1:pMGbdgHQQ8Lt4vN7lJyaFI/OUBU= sha256:UaeA0YT4NL3idx17D8eK+xyzANmOsYqspfdPusTyhVQ=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 40F89125F7D; Sat, 28 Nov 2026 15:54:51 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id K6acpC3Rmm8n;
Sat, 28 Nov 2026 15:54:48 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373120-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 22246125F77; Sat, 28 Nov 2026 15:54:40 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 8C31629485; Sat, 28 Nov 2026 12:54:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 641D8606A324;
Sat, 28 Nov 2026 12:54:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=abtuH4Ky
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=209.85.214.169
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
t=1795870472;
b=mqX0YZAMYgIr+eq4p5jDJ7pAQy8w8yfmmd92+uCrxP6lm1BDiZEExPF2ZHgE0HahEdFf
4FbgRyfjclBp/dyRTGiOTG/yND/xdBIf1RoYqG2m4tM7wZFY5788xyc3d/E1+xk9+FTSn
gUxvlq2xnVn09w5jN6JZSBFJWMWakeLAaWnWZCOG5vgbMo2yxtJFdTGlhBhQA32a8242I
Sg+FiuEniu2IIP1uDTkl28cSqW5SCq7cMS1v/Nmz9Uyqmy6hKsqdlDE+I2fDPGjEr/svg
xcCcOuaFEmeiWldjZGE4Pp8NDNCZitmA9eZ7TkrWPFr5evCz251uTl4Fzl9T5wpKmmA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795870472;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:MIME-Version:References:
In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type;
bh=gnF98RXlARFo9XyCDL2rqNyyuvHMMADxub4w4sqKGto=;
b=DGymJCVTehwcYWPJp7x1rvO+QTKtdkUULvGK+TODXgXUOs+gR1ibysdVRVpOc5Pj8lFF
kgxTJ5RCmJDZoQtJAYIfQHzXogD49wgLE3yPodbXSelAzSQVjfdL4Z7dnGjDmEbHNHB0A
7sBtz2PLd47r+D/tAmSiOafnDO5BUwaWBsbSugS2mlmJ0CryVZZ1MkIVjb3JmnWUo6edJ
6R5SKESK9WUEvmZVXDTLXnLhLR4Wnb5MdsxbbhKXSRqamMChJYXlkj1GjyItzJZV8tQD5
1eNJV5iFMx6CgKSWAzKOeHZ2I1SPk8E9avcSlWaTmD585WoP8hb52FnxaZVggwaB0bg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=abtuH4Ky;
arc=fail smtp.remote-ip=209.85.214.169
X-Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39EF5606A31F
for <netdev@vger.kernel.org>; Sat, 28 Nov 2026 12:54:32 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 39EF5606A31F
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2f04b676219so48457135ad.0
for <netdev@vger.kernel.org>; Sat, 28 Nov 2026 04:54:32 -0800 (PST)
X-ARC-Seal: i=1; a=rsa-sha256; t=1795870471; cv=none;
d=google.com; s=arc-20260327;
b=SvMYbl34njc9pExe7J7SqRqZ95DtFySV42okP1qD18W3KoXOLXOL80EkcNg4KVYxB+
Ls1L6ekuB30Vnel9IoK8nau0S9E/kUOBv+thEdqQOyxQwFsBJYG30qqEjpU8/HlZHs+D
ZsQXYa1SFBdCEwZBKGtSwW/7ByeU0PG1KDLvs2jlG6uSwtGJG4RONpRLYW7MwYHS18eG
CH1emTDqLDWb2ImE6wSzbKt0b3/SP3BNkQsrxhwQqmOEl9P5OErloLHxRKG0WW8mUfN4
hfaIFn89DQX57F+ASTCA1WX3lhbF6jrCDKxGe1/B6nJ8jMsG5eWo2aatzryOpq2hbNLl
DldQ==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:dkim-signature;
bh=gnF98RXlARFo9XyCDL2rqNyyuvHMMADxub4w4sqKGto=;
fh=zb/iwYzdAp6mtK2lv71+ZJZyzrYnWNmHVj+z5pExiRU=;
b=f2D6mm6C1pU86/oovzXOLW5MeH6sCcyCRuQNRKNQwPJ6kGxvxq63brfQTq0XGL/zHI
Z6L9JJWvejmpYej0e9wDI+L2JuG1BCCfmqSR4X8h62rRSXBJLgCrntZVJvUzt5VElAji
DU+oVfi+xI7BpnPd5JIdiyqtDE5j74Im0TaZf43A13/0tQboHeRa8cL4/KmW6hm3m6fZ
yvp1Q4gK/dJqTZxr+oxhHAv5ueI7R1sWdKdxpIh8BXbOkldIQhRufV+EPMw40S0NK0st
5wTMMzIYTA0aSj9hbM9aoYTCCnnYSm4aIIYq5yoenT5RI4IWhXoJ9AUGx4ffFstMUSAr
3TVw==;
darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1795870471; x=1796475271; darn=vger.kernel.org;
h=content-type:cc:to:subject:message-id:date:from:in-reply-to
:references:mime-version:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=gnF98RXlARFo9XyCDL2rqNyyuvHMMADxub4w4sqKGto=;
b=abtuH4KyDBjFvSqA6VZ6BlJNrIWWliV0VzysS0H45HzvFp52iFmv2plSh/3+5HxodR
0/FLI1uDF91TvF+ozU3kcjgs2TDl3RJMnE2W0kahomommooxyU71ZKb2FQC7KZiHKLQd
nppcymj5poVj1rp5PxbBeiGakUuddebKWv0Dftz/Xpn1V8iLswot4d3hdYemmfKbskuS
qmwhKrhKwAP72wwWgV4FFMtturEvGZrXz0GjTUIRpUsLrpQoGuRkGOFnNLzXGT/GjH/H
oEK1AMXsBqIc2GsFXYdpeRUl9k3hU/FxXzATsod3AEuHVd2O5QXIPac+hUO0e4PWKvTr
FRVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795870471; x=1796475271;
h=content-type:cc:to:subject:message-id:date:from:in-reply-to
:references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to:content-type;
bh=gnF98RXlARFo9XyCDL2rqNyyuvHMMADxub4w4sqKGto=;
b=z4TP9K9om8W57VURXUvGpYtWdOEdeuh/orO+2ckEGCzaD3wI2CxtNGmKoYjKqoQJtg
bUMagt61C4zHf4hTyRjEM4Y3ipq+dOBfc+fvTzD/pviAgbbluoGRIuirXfjFDzPe4WP0
Gqf3G/XMFl4Lhqhk5WqW9YPfWFwIOd/QDSXU9xy2i6F+mrDaq82seghyMpaI6NKpqYr4
oUQkURQpY9pBkpjwY2F5HBpqYRVhqmIXdje/JKK1A1sL+i3BSsq9G6yHa6Q9qa/65Hl0
KrvmMsTI2SQUGsX0apM7iRjmJRmfu8H6p36XKZOMkycRSMVM1MU5EWS92uZaHq8gb0D1
uJ6w==
X-Gm-Message-State: APuU4Z/utbi3QbRXbcZp6xwN8lXnMW+iEZgmMQcQn9HowEGHutuahIWT
O5Q+CQc5CS2y5ESwCra0HcfPdn3vq/Vo7aDdyNOEy9LCaSA4QeqHNGKlUT8C9pv2nGHARjItUex
0YjyyLXt6c6xQMzCzgiC8Mte3T8J9jKo=
X-Gm-Gg: AZFdTZefeEGm9YmqEmPH5w6pDwfh+zSCs4WGkRYLdXqO6SF5BUQxZraVsJCmyxmSjOm
q6Tuitqln5weX8EQEMGNcu+BtZxmI2aiox0waNIva8mTorjPdqIQWH8ISZdjuK0wxg/f/8IAQao
7dQIRl6u11Tpiifq4NLiNiyp0ypUStjInb2pCYNAmjRVBNMOsH+ln952u2S/d5e9Ef4qcEu+mUR
DqU/PrFgJlvzimDz9fwR+IoLPAsXzI8WMj7ffYEScseLpAEPLHOnvxmMkrjxmBhwJfRyBwv4Z2I
VwuMAvo5R3xiorAAxh5lKL/08LTtHUqqtEVcEimu5rnPpWfHMRElH7CG6sINgul9c88V0JsaxsS
jO7VnyyMBmGNQMwRBBTzrqzpGVZtGgj8MvJZEAscSW6drymngLmUSkyrIFXJ31qFzTO8HdQstqr
QYcuowIUAN+BZ5tYa7yb/jXQobFJnn/g==
X-Received: by 2002:a17:902:ce0d:b0:2e9:3dd2:a8fe with SMTP id
d9443c01a7336-2f03f1537bamr267270635ad.21.1795870471414; Sat, 28 Nov 2026
04:54:31 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261126080401.GA540848@shredder>
X-Gm-Features: Aa3M54ria_od_EkqrWHlDNJ4pZq0kitwSRrAVL5yCqfJ9vqj3aerXEcud_9OaNc
X-Cc: netdev <netdev@vger.kernel.org>, David Miller <davem@davemloft.net>, dsahern@kernel.org,
eric.dumazet@gmail.com, kuba@kernel.org, willemdebruijn.kernel@gmail.com,
LKML <linux-kernel@vger.kernel.org>