Re: [PATCH v2] net: fix a double free issue for neighbour entry

2015-05-20 Thread Julian Anastasov
Hello, On Wed, 20 May 2015, Ying Xue wrote: Yes, this way is absolutely safe for us! But, for example, if we check refcnt==0 in write_lock protection, the checking is a bit late. Instead, if the checking is advanced to ip_finish_output2(), we can _early_ find the fact that we

Re: [PATCH v2] net: fix a double free issue for neighbour entry

2015-05-19 Thread Eric Dumazet
On Wed, 2015-05-20 at 09:25 +0800, Ying Xue wrote: Calling __ipv4_neigh_lookup_noref() inside rcu_read_lock_bh() can guarantee that its searched neighbour entry is not freed before RCU grace period, but it cannot ensure that its obtained neighbour will be freed shortly. Exactly saying, it