]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: don't release rt->rt6i_pcpu memory during rt6_release()
authorWei Wang <weiwan@google.com>
Fri, 6 Oct 2017 19:06:05 +0000 (12:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Oct 2017 20:22:58 +0000 (21:22 +0100)
commitd99303ca21067765098a1690a24100decbb06b4f
treeb37f6853d0bdedc6a46cd44d1f2484208ace1ca5
parent1c5a73cc75ac207c8f7e6e465c4a1413efbba44f
ipv6: don't release rt->rt6i_pcpu memory during rt6_release()

After rwlock is replaced with rcu and spinlock, route lookup can happen
simultanously with route deletion.
This patch removes the call to free_percpu(rt->rt6i_pcpu) from
rt6_release() to avoid the race condition between rt6_release() and
rt6_get_pcpu_route(). And as free_percpu(rt->rt6i_pcpu) is already
called in ip6_dst_destroy() after the rcu grace period, it is safe to do
this change.

Signed-off-by: Wei Wang <weiwan@google.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_fib.c