ipv4: route: fix drop reason being overridden in ip_route_input_slow
Subsystems (3)
PATCH 1/1 ipv4: route: fix drop reason being overridden in ip_route_input_slow
When jumping to 'martian_destination' a drop reason is always set but that label falls-through the 'e_nobufs' one, overriding the value.
The behavior was introduced by the mentioned commit. The logic went from,
goto martian_destination; ... martian_destination: ... e_inval: err = -EINVAL; goto out; e_nobufs: err = -ENOBUFS; goto out;
to,
reason = ...; goto martian_destination; ... martian_destination: ... e_nobufs: reason = SKB_DROP_REASON_NOMEM; goto out;
A 'goto out' is clearly missing now after 'martian_destination' to avoid overriding the drop reason.
--- net/ipv4/route.c | 1 + 1 file changed, 1 insertion(+)
net/ipv4/route.c +1 -0
@@ -2445,6 +2445,7 @@ ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,net_warn_ratelimited ("martian destination %pI4 from %pI4, dev %s\n" , &daddr, &saddr, dev->name);#endif + goto out; e_nobufs: reason =SKB_DROP_REASON_NOMEM ;
Signature · 1 line
2.47.1
Quoted 2 lines · Antoine Tenart
When jumping to '
martian_destination' a drop reason is always set but that label falls-through the 'e_nobufs' one, overriding the value.
[...]
Quoted 10 lines
A 'goto out' is clearly missing now after '
martian_destination' to avoid overriding the drop reason.Fixes 5b92112acd8e ("net: ip: make ip_route_input_slow() return drop reasons")Reported-by Sabrina Dubroca <[email protected]>Cc Menglong Dong <[email protected]>Signed-off-by Antoine Tenart <[email protected]>--- net/ipv4/route.c | 1 + 1 file changed, 1 insertion(+)
Thanks Antoine.
Signature · 1 line
Sabrina
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 17 lines · On Wed, 8 Jan 2025 17:57:15 +0100 you wrote:
When jumping to '
martian_destination' a drop reason is always set but that label falls-through the 'e_nobufs' one, overriding the value.The behavior was introduced by the mentioned commit. The logic went from,
goto martian_destination; ... martian_destination: ... e_inval: err = -EINVAL; goto out; e_nobufs: err = -ENOBUFS; goto out;
Quoted 1 line
[...]
Here is the summary with links:
- [net] ipv4: route: fix drop reason being overridden in ip_route_input_slow
https://git.kernel.org/netdev/net/c/8c7a6efc017e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html