Re: Bug in net/ipv6/ip6_fib.c:fib6_dump_table()

From: David Miller
Date: Mon Jun 25 2012 - 18:40:43 EST


From: Eric Dumazet <eric.dumazet@xxxxxxxxx>
Date: Sat, 23 Jun 2012 07:37:31 +0200

> [PATCH] ipv6: fib: fix fib dump restart
>
> Commit 2bec5a369ee79576a3 (ipv6: fib: fix crash when changing large fib
> while dumping it) introduced ability to restart the dump at tree root,
> but failed to skip correctly a count of already dumped entries. Code
> didn't match Patrick intent.
>
> We must skip exactly the number of already dumped entries.
>
> Note that like other /proc/net files or netlink producers, we could
> still dump some duplicates entries.
>
> Reported-by: Debabrata Banerjee <dbavatar@xxxxxxxxx>
> Reported-by: Josh Hunt <johunt@xxxxxxxxxx>
> Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>

I've applied this.

But I wonder if it does the right thing, to be honest.

When tree change is detected, w->skip is set to w->count

But with your change, w->count won't be the number of entries to
skip from the root after the first time we handle a tree change.

So on the second tree change, we'll skip the wrong number of
entries, since the w->count we save into w->skip will be biased
by the previous w->skip value. So we'll skip too few entries.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/