ipv4: icmp: reject broadcast/multicast routes
Subsystems (3)
PATCH 1/1 ipv4: icmp: reject broadcast/multicast routes
syzbot was able to trigger ip_rt_bug() in a loop, using an IPv4 packet with a crafted IPOPT_SSRR option:
options: ipv4_options {
options: array[ipv4_option] {
union ipv4_option {
ssrr: ipv4_option_route[IPOPT_SSRR] {
type: const = 0x89 (1 bytes)
length: len = 0x7 (1 bytes)
pointer: int8 = 0xa2 (1 bytes)
data: array[ipv4_addr] {
union ipv4_addr {
broadcast: const = 0xffffffff (4 bytes)
}
}
}
}Change __icmp_send() to not send ICMP to broadcast/multicast destinations.
Fixes c378a9c019cf ("ipv4: Give backtrace in ip_rt_bug().")
Reported-by [email protected]
Signed-off-by Eric Dumazet <[email protected]>
--- net/ipv4/icmp.c | 3 +++ 1 file changed, 3 insertions(+)
net/ipv4/icmp.c +3 -0
@@ -961,6 +961,9 @@ void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,if (IS_ERR (rt)) goto out_unlock; +if (rt->rt_flags & (RTCF_BROADCAST |RTCF_MULTICAST )) + goto ende; +/* peer icmp_ratelimit */ if (!icmpv4_xrlim_allow (net, rt, &fl4, type, code, apply_ratelimit)) goto ende;
Signature · 1 line
2.54.0.631.ge1b05301d1-goog
Quoted 20 lines · Eric Dumazet
syzbot was able to trigger
ip_rt_bug()in a loop, using an IPv4 packet with a craftedIPOPT_SSRRoption:options: ipv4_options { options: array[ipv4_option] { union ipv4_option { ssrr: ipv4_option_route[IPOPT_SSRR] { type: const = 0x89 (1 bytes) length: len = 0x7 (1 bytes) pointer: int8 = 0xa2 (1 bytes) data: array[ipv4_addr] { union ipv4_addr { broadcast: const = 0xffffffff (4 bytes) } } } }Change
__icmp_send()to not send ICMP to broadcast/multicast destinations.
Quoted 8 lines
Fixes c378a9c019cf ("ipv4: Give backtrace in ip_rt_bug().")Reported-by [email protected]Signed-off-by Eric Dumazet <[email protected]>--- net/ipv4/icmp.c | 3 +++ 1 file changed, 3 insertions(+)
Reviewed-by David Ahern <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 18 lines · On Tue, 19 May 2026 20:08:36 +0000 you wrote:
syzbot was able to trigger
ip_rt_bug()in a loop, using an IPv4 packet with a craftedIPOPT_SSRRoption:options: ipv4_options { options: array[ipv4_option] { union ipv4_option { ssrr: ipv4_option_route[IPOPT_SSRR] { type: const = 0x89 (1 bytes) length: len = 0x7 (1 bytes) pointer: int8 = 0xa2 (1 bytes) data: array[ipv4_addr] { union ipv4_addr { broadcast: const = 0xffffffff (4 bytes) } } } }
Quoted 1 line
[...]
Here is the summary with links:
- [net] ipv4: icmp: reject broadcast/multicast routes
https://git.kernel.org/netdev/net/c/7eb72c1e3984
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html