Skip to content

Commit

Permalink
[NETNS]: The ip6_fib_timer can work with garbage on net namespace stop.
Browse files Browse the repository at this point in the history
The del_timer() function doesn't guarantee, that the timer callback
is not active by the time it exits.

Thus, the fib6_net_exit() may kfree() all the data, that is required
by the fib6_run_gc(). The race window is tiny, but slab poisoning can
trigger this bug.

Using del_timer_sync() will cure this.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Apr 21, 2008
1 parent f25c3d6 commit 2aed282
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/ip6_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@ static int fib6_net_init(struct net *net)
static void fib6_net_exit(struct net *net)
{
rt6_ifdown(net, NULL);
del_timer(net->ipv6.ip6_fib_timer);
del_timer_sync(net->ipv6.ip6_fib_timer);
kfree(net->ipv6.ip6_fib_timer);
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
kfree(net->ipv6.fib6_local_tbl);
Expand Down

0 comments on commit 2aed282

Please sign in to comment.