Message ID | 20240614190326.1349786-1-druth@chromium.org (mailing list archive) |
---|---|
State | Accepted |
Commit | d864319871b05fadd153e0aede4811ca7008f5d6 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v3,net] net/sched: act_api: fix possible infinite loop in tcf_idr_check_alloc() | expand |
Hello: This patch was applied to netdev/net.git (main) by Paolo Abeni <pabeni@redhat.com>: On Fri, 14 Jun 2024 19:03:26 +0000 you wrote: > syzbot found hanging tasks waiting on rtnl_lock [1] > > A reproducer is available in the syzbot bug. > > When a request to add multiple actions with the same index is sent, the > second request will block forever on the first request. This holds > rtnl_lock, and causes tasks to hang. > > [...] Here is the summary with links: - [v3,net] net/sched: act_api: fix possible infinite loop in tcf_idr_check_alloc() https://git.kernel.org/netdev/net/c/d864319871b0 You are awesome, thank you!
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 9ee622fb1160..2520708b06a1 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -830,7 +830,6 @@ int tcf_idr_check_alloc(struct tc_action_net *tn, u32 *index, u32 max; if (*index) { -again: rcu_read_lock(); p = idr_find(&idrinfo->action_idr, *index); @@ -839,7 +838,7 @@ int tcf_idr_check_alloc(struct tc_action_net *tn, u32 *index, * index but did not assign the pointer yet. */ rcu_read_unlock(); - goto again; + return -EAGAIN; } if (!p) {