Skip to content

Commit 51e398e

Browse files
tracywwnjdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a94b936 commit 51e398e

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

net/ipv6/ip6_fib.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,6 @@ void rt6_free_pcpu(struct rt6_info *non_pcpu_rt)
190190
*ppcpu_rt = NULL;
191191
}
192192
}
193-
194-
free_percpu(non_pcpu_rt->rt6i_pcpu);
195-
non_pcpu_rt->rt6i_pcpu = NULL;
196193
}
197194
EXPORT_SYMBOL_GPL(rt6_free_pcpu);
198195

0 commit comments

Comments
 (0)