]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ipv4: use WARN_ON_ONCE() in ip_rt_bug()
authorEric Dumazet <edumazet@google.com>
Tue, 19 May 2026 19:32:48 +0000 (19:32 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 May 2026 02:00:36 +0000 (19:00 -0700)
It turns out ip_rt_bug() can be called more than expected.

syzbot will still panic (because of panic_on_warn=1), but non debug
kernels will no longer die while repeating stack traces on the console.

Fixes: c378a9c019cf ("ipv4: Give backtrace in ip_rt_bug().")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://patch.msgid.link/20260519193248.4018872-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/route.c

index bc1296f0ea69b0705e00e547a0d550129e03326a..3d62d45d84bda986db8b3592c0c7f5c81da3fb7e 100644 (file)
@@ -1272,7 +1272,7 @@ static int ip_rt_bug(struct net *net, struct sock *sk, struct sk_buff *skb)
                 __func__, &ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr,
                 skb->dev ? skb->dev->name : "?");
        kfree_skb(skb);
-       WARN_ON(1);
+       WARN_ON_ONCE(1);
        return 0;
 }