Re: [PATCH v1 net] net/sched: cls_api: Don't replay RTM_GETCHAIN in tc_ctl_chain().
From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: 2026-09-09 22:03:49
On Wed, Sep 9, 2026 at 12:47 PM Kuniyuki Iwashima [off-list ref] wrote:
On Wed, Sep 9, 2026 at 3:01 AM Jamal Hadi Salim [off-list ref] wrote:quoted
On Tue, Sep 8, 2026 at 4:55 PM Kuniyuki Iwashima [off-list ref] wrote:quoted
If a netlink socket sends RTM_GETCHAIN requests repeatedly without recv()ing the responses, tc_ctl_chain() hogs CPU and triggers Hung Task splat. [0] As caught in the stack trace, netlink_attachskb() could confuse tc_ctl_chain() by returning -EAGAIN when the userspace netlink socket's receive buffer is full. The replay: label exists since commit 32a4f5ecd738 ("net: sched: introduce chain object to uapi") but was not used initially. Since commit 9f407f1768d3 ("net: sched: introduce chain templates"), the label is needed for RTM_NEWCHAIN because tcf_proto_lookup_ops() may release RTNL to call request_module(). However, the replay logic is unnecessary for RTM_GETCHAIN. Let's apply the replay logic only for RTM_NEWCHAIN.The patch looks sane. Can you send me a reproducer please? We are automating and testing of all tc submissions. Reviewed-by: Jamal Hadi SalimFTR, sent the repro offlist and asked to resend the tag with the email address.
Thanks. Our system has tested this before and after the patch and including relevant tdc tests and it is fine. Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> Tested-by: hybris@mojatatu.ai cheers, jamal
Thanks !