Re: [RFC] net: Replace del_timer() with del_timer_sync()

2014-08-11 Thread Deepak
Thanks for the clarification Eric. I re-analysed the code and found that sk_stop_timer() is called under lock_sock(sk)/bh_lock_sock(sk) so we can not replace del_timer() with del_timer_sync() here and will lead to dead-lock as you suggested . Thanks, Deepak Das On Thursday 07 August 2014 10:1

RE: [RFC] net: Replace del_timer() with del_timer_sync()

2014-08-07 Thread Eric Dumazet
On Thu, 2014-08-07 at 15:15 +, Das, Deepak wrote: Please do not top post on netdev, thanks. > I apologies for not explaining the scenario previously. > > sk_stop_timer() is used to stop the tcp timers with expiry callback > tcp_write_timer(), tcp_delack_timer(), tcp_keepalive_timer(), ... >

RE: [RFC] net: Replace del_timer() with del_timer_sync()

2014-08-07 Thread Das, Deepak
pinics.net/lists/linux-bluetooth/msg51132.html with warm regards, Deepak Das From: Eric Dumazet [eric.duma...@gmail.com] Sent: Thursday, August 07, 2014 12:25 PM To: Das, Deepak Cc: da...@davemloft.net; net...@vger.kernel.org; linux-kernel@vger.kernel.org

Re: [RFC] net: Replace del_timer() with del_timer_sync()

2014-08-06 Thread Eric Dumazet
On Thu, 2014-08-07 at 11:48 +0530, Deepak wrote: > on SMP system, del_timer() might return even if the timer function > is running on other cpu so sk_stop_timer() will execute __sock_put() > while timer is accessing the socket on other cpu causing > "use-after-free". > > This commi

[RFC] net: Replace del_timer() with del_timer_sync()

2014-08-06 Thread Deepak
on SMP system, del_timer() might return even if the timer function is running on other cpu so sk_stop_timer() will execute __sock_put() while timer is accessing the socket on other cpu causing "use-after-free". This commit replaces del_timer() with del_timer_sync() in sk_stop_t