Commit 1fde0ca3 authored by Jianbo Liu's avatar Jianbo Liu Committed by Jakub Kicinski

net/sched: flower: Add lock protection when remove filter handle

As IDR can't protect itself from the concurrent modification, place
idr_remove() under the protection of tp->lock.

Fixes: 08a0063d ("net/sched: flower: Move filter handle initialization earlier")
Signed-off-by: default avatarJianbo Liu <jianbol@nvidia.com>
Reviewed-by: default avatarCosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: default avatarGal Pressman <gal@nvidia.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Link: https://lore.kernel.org/r/20240220085928.9161-1-jianbol@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 61c43780
......@@ -2460,8 +2460,11 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
}
errout_idr:
if (!fold)
if (!fold) {
spin_lock(&tp->lock);
idr_remove(&head->handle_idr, fnew->handle);
spin_unlock(&tp->lock);
}
__fl_put(fnew);
errout_tb:
kfree(tb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment