Message ID | 20210810034305.63997-1-mbloch@nvidia.com (mailing list archive) |
---|---|
State | Accepted |
Commit | a5397d68b2dbdb8f725ab2ff420171fbde39dbe5 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,v2] net/sched: cls_api, reset flags on replay | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | fail | 1 blamed authors not CCed: davem@davemloft.net; 2 maintainers not CCed: davem@davemloft.net kuba@kernel.org |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 8 this patch: 8 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 15 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 8 this patch: 8 |
netdev/header_inline | success | Link |
On Tue, Aug 10, 2021 at 03:43:05AM +0000, Mark Bloch wrote: > tc_new_tfilter() can replay a request if it got EAGAIN. The cited commit > didn't account for this when it converted TC action ->init() API > to use flags instead of parameters. This can lead to passing stale flags > down the call chain which results in trying to lock rtnl when it's > already locked, deadlocking the entire system. > > Fix by making sure to reset flags on each replay. [...] > Fixes: 695176bfe5de ("net_sched: refactor TC action init API") > Signed-off-by: Mark Bloch <mbloch@nvidia.com> > Reviewed-by: Vlad Buslov <vladbu@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Tested-by: Ido Schimmel <idosch@nvidia.com>
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Tue, 10 Aug 2021 03:43:05 +0000 you wrote: > tc_new_tfilter() can replay a request if it got EAGAIN. The cited commit > didn't account for this when it converted TC action ->init() API > to use flags instead of parameters. This can lead to passing stale flags > down the call chain which results in trying to lock rtnl when it's > already locked, deadlocking the entire system. > > Fix by making sure to reset flags on each replay. > > [...] Here is the summary with links: - [net-next,v2] net/sched: cls_api, reset flags on replay https://git.kernel.org/netdev/net-next/c/a5397d68b2db You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 69185e311422..4a7043a4e5d6 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -1949,7 +1949,7 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n, int err; int tp_created; bool rtnl_held = false; - u32 flags = 0; + u32 flags; if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) return -EPERM; @@ -1970,6 +1970,7 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n, tp = NULL; cl = 0; block = NULL; + flags = 0; if (prio == 0) { /* If no priority is provided by the user,