|
|
Message-ID:
<DU4P194MB29712EE7A66CF6E9294CEB7EA74B2@DU4P194MB2971.EURP194.PROD.OUTLOOK.COM>
Date: Thu, 3 Dec 2026 12:03:18 +0000
From: James Sawyer <jamessawyer@...look.com>
To: "oss-security@...ts.openwall.com" <oss-security@...ts.openwall.com>
Subject: Linux kernel >= 4.16 IPv4 forwarding: forged ICMP PMTU below min_pmtu
is honoured by routers (remote DoS of forwarded DF traffic); GRE silently
drops IPv6 below 1280
Hello,
Two related Linux kernel networking issues. Fixes were posted to netdev
on 2026-12-03:
https://lore.kernel.org/netdev/?q=s%3A%22ipv4%3A+do+not+trust+ICMP-locked+PMTU+while+forwarding%22
https://lore.kernel.org/netdev/?q=s%3A%22ip_tunnel%3A+fragment+IPv6+payload+when+the+tunnel+MTU+is+below+IPV6_MIN_MTU%22
Write-up: https://blog.jamessawyer.co.uk/2026/linux-router-forged-icmp-pmtu-forwarding/
1. IPv4 forwarding honours a forged path MTU below min_pmtu (since v4.16)
Since f87c10a8aa1e (2014), ip_dst_mtu_maybe_forward() ignores ICMP-learned path
MTUs on forwarded packets, because they can be forged, unless the route is
locked. d52e5a7e7ca4 (v4.16, 2018) marked ICMP-learned values below
net.ipv4.route.min_pmtu (552) as locked, to stop hosts setting DF on their own
packets, and switched the forwarding check to ip_mtu_locked(). So a forged value
below 552 is the one learned PMTU that forwarding trusts.
One ICMP type 3 code 4 sent to a Linux router, from the sender's own address,
quoting a UDP packet from the router to destination D with next-hop MTU 551,
creates "D ... mtu lock 552" for 600 s (renewable). No socket has to
match: a quoted ICMP echo reply is handled by icmp_err() (present before
v4.16), and a quoted UDP packet by udp_err_update_exception() on kernels
with 4c3499f79f8c (2026). We measured both. The router then drops every forwarded IPv4 DF
packet larger than 552 bytes to D and returns frag-needed (552) to the sender.
For hosts behind the router, DF traffic above that size to D fails: in our
tests 1200-byte UDP payloads with IP_PMTUDISC_DO and IP_PMTUDISC_PROBE, i.e.
QUIC-sized datagrams, 0 of 3 delivered; non-DF UDP got through, and TCP
transfers completed with the MSS to D reduced from 1448 to 500.
Measured on 7.0.0-43-generic (Ubuntu 26.04) in network namespaces, 3 runs plus
controls, reproduced independently on a second VM with separately written
scripts, and on v7.4-rc1 in QEMU. A forged MTU of 1000 (stored unlocked) has no effect, and with
route.min_pmtu=68 the same 551 is stored unlocked and has no effect.
Reach: the router must accept the unsolicited ICMP on its input path. It does
with no input filter, with ufw's default before.rules (which accept every
destination-unreachable), or with an explicit frag-needed accept rule. A strict
"ct state established,related" input policy blocks it from outside. An inside
host (needs CAP_NET_RAW) can do it against a gateway that trusts its LAN, and
so deny the other hosts behind that gateway.
Native IPv6 forwarding is not affected. IPVS and ipmr have separate MTU logic
and were not tested.
Mitigation on routers, either:
nft: table inet pmtuguard { chain in { type filter hook input priority -10;
policy accept; icmp type destination-unreachable icmp code frag-needed
@th,48,16 < 552 counter drop } }
or: sysctl net.ipv4.route.min_pmtu=68 (router's own traffic can then be
clamped that low)
2. ip_tunnel (GRE) carrying IPv6 drops packets silently when the tunnel MTU < 1280
If the underlay path MTU leaves less than 1280 bytes for an IPv6 payload,
tnl_update_pmtu() sends no Packet Too Big (none is possible below 1280) and
keeps outer DF, so ip_fragment() drops the packet. A forged frag-needed to a
GRE endpoint with an unlocked value 552..1303 triggers it. Measured: IPv6 UDP
1232-byte payloads over GRE 0 of 3 delivered, no ICMPv6 PTB seen on the sender
(4 runs). sit already clears DF in this case; the proposed fix does the same.
Both fixes were tested on v7.4-rc1 in QEMU: with them applied, the forwarded
traffic is unaffected and IPv6 over GRE is delivered. No CVE has been
requested by me.
This was found with AI assistance; all results were measured in my own lab.
A reproducer is available to maintainers on request and is not being published.
James Sawyer
Powered by blists - more mailing lists
Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.