Re: [PATCH net] ipv6: use fib6_info_hold_safe() when necessary

2018-07-23 Thread Martin KaFai Lau
On Sat, Jul 21, 2018 at 08:56:32PM -0700, Wei Wang wrote: > From: Wei Wang > > In the code path where only rcu read lock is held, e.g. in the route > lookup code path, it is not safe to directly call fib6_info_hold() > because the fib6_info may already have been deleted but still exists > in the

Re: [PATCH net] ipv6: use fib6_info_hold_safe() when necessary

2018-07-23 Thread David Miller
From: Wei Wang Date: Sat, 21 Jul 2018 20:56:32 -0700 > From: Wei Wang > > In the code path where only rcu read lock is held, e.g. in the route > lookup code path, it is not safe to directly call fib6_info_hold() > because the fib6_info may already have been deleted but still exists > in the rcu

Re: [PATCH net] ipv6: use fib6_info_hold_safe() when necessary

2018-07-23 Thread David Ahern
On 7/21/18 9:56 PM, Wei Wang wrote: > From: Wei Wang > > In the code path where only rcu read lock is held, e.g. in the route > lookup code path, it is not safe to directly call fib6_info_hold() > because the fib6_info may already have been deleted but still exists > in the rcu grace period. Hold

[PATCH net] ipv6: use fib6_info_hold_safe() when necessary

2018-07-21 Thread Wei Wang
From: Wei Wang In the code path where only rcu read lock is held, e.g. in the route lookup code path, it is not safe to directly call fib6_info_hold() because the fib6_info may already have been deleted but still exists in the rcu grace period. Holding reference to it could cause double free and