From: Davide Caratti <dcara...@redhat.com> Date: Tue, 19 Jun 2018 15:39:46 +0200
> a recursive lock warning [1] can be observed with the following script, ... > in case the kernel was unable to run the last command (e.g. because of > the impossibility to load 'act_meta_skbtcindex'). For a similar reason, > the kernel can leak idr in the error path of tcf_ife_init(), because > tcf_idr_release() is not called after successful idr reservation: ... > Since tcfa_lock is already taken when the action is being edited, a call > to tcf_idr_release() wrongly makes tcf_idr_cleanup() take the same lock > again. On the other hand, tcf_idr_release() needs to be called in the > error path of tcf_ife_init(), to undo the last tcf_idr_create() invocation. > Fix both problems in tcf_ife_init(). > Since the cleanup() routine can now be called when ife->params is NULL, > also add a NULL pointer check to avoid calling kfree_rcu(NULL, rcu). > > [1] ... > Fixes: 4e8c86155010 ("net sched: net sched: ife action fix late binding") > Fixes: ef6980b6becb ("introduce IFE action") > Signed-off-by: Davide Caratti <dcara...@redhat.com> Applied and queued up for -stable.