Netdev List
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Shivani Gupta <shivani07g@gmail.com>
Cc: netdev@vger.kernel.org, Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	syzbot+8f1c492ffa4644ff3826@syzkaller.appspotmail.com
Subject: Re: [PATCH] net/sched: act_api: avoid dereferencing ERR_PTR in tcf_idrinfo_destroy
Date: Sat, 3 Jan 2026 20:09:41 -0800	[thread overview]
Message-ID: <aVnoBRuEMazh2Q1F@pop-os.localdomain> (raw)
In-Reply-To: <20260102232116.204796-1-shivani07g@gmail.com>

On Fri, Jan 02, 2026 at 11:21:16PM +0000, Shivani Gupta wrote:
> 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.
> 
> 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>

Thanks for the patch, Shivani.

Could you provide a Fixes tag for this while you are on it?

> ---
>  net/sched/act_api.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index ff6be5cfe2b0..994f7ffe26a5 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -940,6 +940,10 @@ void tcf_idrinfo_destroy(const struct tc_action_ops *ops,
>  	int ret;
>  
>  	idr_for_each_entry_ul(idr, p, tmp, id) {
> +		if (IS_ERR(p)) {
> +			WARN_ON_ONCE(1);

Hm, I guess we should remove this warning here since ERR_PTR is expected
in some corner case?

Regards,
Cong Wang

  reply	other threads:[~2026-01-04  4:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-02 23:21 [PATCH] net/sched: act_api: avoid dereferencing ERR_PTR in tcf_idrinfo_destroy Shivani Gupta
2026-01-04  4:09 ` Cong Wang [this message]
2026-01-05  0:59 ` [PATCH v2] " Shivani Gupta
2026-01-07  1:40   ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aVnoBRuEMazh2Q1F@pop-os.localdomain \
    --to=xiyou.wangcong@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shivani07g@gmail.com \
    --cc=syzbot+8f1c492ffa4644ff3826@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox