Skip to content

Commit adb25a4

Browse files
shivanigupta-devkuba-moo
authored andcommitted
net/sched: act_api: avoid dereferencing ERR_PTR in tcf_idrinfo_destroy
syzbot reported a crash in tc_act_in_hw() during netns teardown where tcf_idrinfo_destroy() passed an ERR_PTR(-EBUSY) value as a tc_action pointer, leading to an invalid dereference. Guard against ERR_PTR entries when iterating the action IDR so teardown does not call tc_act_in_hw() on an error pointer. Fixes: 84a7d67 ("net/sched: acp_api: no longer acquire RTNL in tc_action_net_exit()") Link: https://syzkaller.appspot.com/bug?extid=8f1c492ffa4644ff3826 Reported-by: syzbot+8f1c492ffa4644ff3826@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=8f1c492ffa4644ff3826 Signed-off-by: Shivani Gupta <shivani07g@gmail.com> Link: https://patch.msgid.link/20260105005905.243423-1-shivani07g@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 13ff3e7 commit adb25a4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

net/sched/act_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,8 @@ void tcf_idrinfo_destroy(const struct tc_action_ops *ops,
940940
int ret;
941941

942942
idr_for_each_entry_ul(idr, p, tmp, id) {
943+
if (IS_ERR(p))
944+
continue;
943945
if (tc_act_in_hw(p) && !mutex_taken) {
944946
rtnl_lock();
945947
mutex_taken = true;

0 commit comments

Comments
 (0)