From: netdev-bot+sashiko@kernel.org
To: jedrzej.jagielski@intel.com
Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com,
kuba@kernel.org, jhs@mojatatu.com, jiri@resnulli.us,
edumazet@google.com
Subject: Re: [PATCH net v4 2/5] net/sched: cls_u32: remove erroneous refcount_inc()
Date: Fri, 04 Dec 2026 14:02:40 +0000 [thread overview]
Message-ID: <179639296014.3146.10241070479974790312@kernel.org> (raw)
In-Reply-To: <20261203124056.547555-3-jedrzej.jagielski@intel.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message describes the removed refcount_inc() as "a
forward fix for currently dead code, which will be uncovered by the…
--
net/sched: cls_u32: remove erroneous refcount_inc()
This patch removes the refcount_inc() on the old linked tc_u_hnode in the
u32_replace_hw_knode() error path of u32_change(). The decrement done by
u32_set_parms() is already balanced by the increment in u32_init_knode(),
so the extra refcount_inc() leaks the hash table.
Closes: https://sashiko.dev/#/patchset/20260807100356.1083774-1-jedrzej.jagielski%40intel.com
> This is a forward fix for currently dead code, which will be uncovered
> by the upcoming patch "net/sched: cls_u32: feed u32_replace_hw_knode()
> with correct set of flags".
[Severity: Low]
This patch has Cc: stable and Fixes: e8d3d78c19be. Is "currently dead
code" true for every stable tree it is meant for?
The branch only became unreachable with 695176bfe5de ("net_sched: refactor
TC action init API") in v5.14. That commit renamed the TCA_U32_FLAGS local
in u32_change() from flags to userflags. It then reused flags for the
kernel TCA_ACT_FLAGS_* word but left the knode call unchanged:
err = u32_replace_hw_knode(tp, new, flags, extack);
Since then, skip_sw has been ignored on this call.
Before v5.14, flags still holds the user's TCA_U32_FLAGS value. Take a
pre-5.14 stable tree that picked up e8d3d78c19be. There, a skip_sw replace
with TCA_U32_LINK that fails to offload would reach this error branch.
Each such failure would raise the old linked tc_u_hnode refcnt by one and
never drop it. A later u32_delete() of that table would then return -EBUSY,
and the table would never be freed.
I can't tell from here whether e8d3d78c19be was actually backported to
pre-5.14 trees, so this part depends on that.
The follow-up flags patch carries Fixes: 695176bfe5de and would not apply
to those older trees.
Could the commit message say that the path is live in pre-v5.14 trees that
contain e8d3d78c19be? Otherwise this patch might be skipped there as only
mattering together with the flags patch.
The refcount change itself looks correct:
- u32_init_knode() takes a reference on the old ht_down.
- u32_set_parms() takes one on the new table and drops one on the old.
- __u32_destroy_key(new) drops the one on the new table.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203124056.547555-1-jedrzej.jagielski%40intel.com
next prev parent reply other threads:[~2026-12-04 14:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 12:40 [PATCH net v4 0/5] net/sched: u32_change() fixes Jedrzej Jagielski
2026-12-03 12:40 ` [PATCH net v4 1/5] net/sched: cls_u32: fix linked hash table refcount leak Jedrzej Jagielski
2026-12-03 12:40 ` [PATCH net v4 2/5] net/sched: cls_u32: remove erroneous refcount_inc() Jedrzej Jagielski
2026-12-04 14:02 ` netdev-bot+sashiko [this message]
2026-12-03 12:40 ` [PATCH net v4 3/5] net/sched: cls_u32: don't remove old HW rule on failed knode replace Jedrzej Jagielski
2026-12-04 14:02 ` netdev-bot+sashiko
2026-12-03 12:40 ` [PATCH net v4 4/5] net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of flags Jedrzej Jagielski
2026-12-03 12:40 ` [PATCH net v4 5/5] selftests: tc-testing: add u32 skip_sw test Jedrzej Jagielski
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=179639296014.3146.10241070479974790312@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=edumazet@google.com \
--cc=jedrzej.jagielski@intel.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/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