On Mon, Aug 20, 2012 at 10:29 PM, Eric Dumazet [off-list ref] wrote:
On Mon, 2012-08-20 at 17:15 -0700, Francesco Ruggeri wrote:
quoted
I
+static void ipmr_free_table(struct mr_table *mrt)
+{
+ del_timer(&mrt->ipmr_expire_timer);
+ mroute_clean_tables(mrt);
+ kfree(mrt);
+}
Seems racy to me.
del_timer() doesnt make sure timer is completely disabled.
Probably need spin_lock_bh(&mfc_unres_lock) /
spin_unlock_bh(&mfc_unres_lock), and maybe del_timer_sync()
I see your point, del_timer_sync should be used to take care of any
pending timers.
I am not sure about the need for further locking though. This function
simply replaces a direct call to kfree(mrt), so I assume by this point
today's code already makes sure no one is going to access this
structure (including to start the timer), or we have a bigger problem
than just the timer.
Maybe someone familiar with ipmr can comment.
Francesco