Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Stephen Hemminger
Tue, 10 Nov 2026 17:26
[PATCH net v2 2/3] ipv6: return EMSGSIZE when first route in dump does not fit
Author: Stephen Hemminger
Date: Tue, 10 Nov 2026 17:26
Date: Tue, 10 Nov 2026 17:26
38 lines
12523 bytes
12523 bytes
If a route does not fit in an empty dump skb, fib6_dump_node()
suspends the walker and inet6_dump_fib() returns 1. rtnl_dumpit()
then returns skb->len, which is 0, and the dump ends with NLMSG_DONE
and status 0, silently dropping the route and those after it.
This became reachable when multipath routes started being dumped as a
single message with an RTA_MULTIPATH attribute; a wide enough route no
longer fits.
Return -EMSGSIZE in this case, as IPv4 does. This depends on the
rtnl_dumpit() fix in the previous patch.
Fixes: beb1afac518d ("net: ipv6: Add support to dump multipath routes via RTA_MULTIPATH attribute")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
net/ipv6/ip6_fib.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index e1d49897d6ab..1025267992f0 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -755,6 +755,12 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
unlock:
rcu_read_unlock();
+ /* The walker stopped before adding anything, so the next route
+ * is too large for this skb. Report that instead of letting an
+ * empty skb look like the end of the dump.
+ */
+ if (err > 0 && !skb->len)
+ err = -EMSGSIZE;
if (err <= 0)
fib6_dump_end(cb);
return err;
--
2.53.0
Re: [PATCH net v2 2/3] ipv6: return EMSGSIZE when first route in dump does not fit
Author: Stephen Hemminger
Date: Thu, 12 Nov 2026 16:17
Date: Thu, 12 Nov 2026 16:17
20 lines
12029 bytes
12029 bytes
On Thu, 12 Nov 2026 17:31:15 +0200
Ido Schimmel <idosch@nvidia.com> wrote:
> >
> > Return -EMSGSIZE in this case, as IPv4 does. This depends on the
> > rtnl_dumpit() fix in the previous patch.
> >
> > Fixes: beb1afac518d ("net: ipv6: Add support to dump multipath routes via RTA_MULTIPATH attribute")
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
> Reviewed-by: Ido Schimmel <idosch@nvidia.com>
>
> FWIW, given that "It takes some non real world stuff to do this", I
> think these patches can be routed via net-next.
The exaggerated security argument is that malicious root in network namespace
can do this and hide/crash ip commands and/or routing daemons in other namespace.
Once again the analyzer is stretching pretty far to argue that.
But then again with the current "lets chain $.01 vulnerabilities" world maybe not.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads