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 calls the fixed path "currently dead code" that only becomes live once "net/sched: cls_u32: feed… -- net/sched: cls_u32: fix linked hash table refcount leak This patch drops the reference on n->ht_down at the errunbind label in u32_change(). With it, a failed u32_replace_hw_knode() call no longer leaks the refcount on the linked tc_u_hnode. The commit message calls this a forward fix for an error path that can't be reached yet.
> 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". > > Fixes: d34e3e181395 ("net: cls_u32: Add support for skip-sw flag to tc u32 classifier.") > Cc: stab…@vger.kernel.org
[Severity: Low] Is "currently dead code" accurate for every tree the Cc: stable tag will reach? In mainline the path does look unreachable. u32_change() passes the kernel request flags (TCA_ACT_FLAGS_*) instead of userflags: err = u32_replace_hw_knode(tp, n, flags, extack); So tc_skip_sw(flags) in u32_replace_hw_knode() is always false. That means tc_setup_cb_add() runs with err_stop=false and returns 0. Before 695176bfe5de ("net_sched: refactor TC action init API") in v5.15, u32_change() passed the user flags directly: flags = nla_get_u32(tb[TCA_U32_FLAGS]); ... err = u32_replace_hw_knode(tp, n, flags, extack); In a tree like 5.10, take a skip_sw filter with TCA_U32_LINK on a block that cannot offload. tc_setup_cb_add() then returns -EOPNOTSUPP. The errhw path frees n with kfree(n) but never drops the refcount on n->ht_down. After that, refcount_dec_if_one() fails in u32_delete(), so deleting the linked hash table returns -EBUSY. In those trees, anyone with CAP_NET_ADMIN in a network namespace can trigger the leak today. This patch also won't apply there as written. v5.10 has no errunbind label and no u32_unbind_filter() call, so it would need a manual backport. The enabling patch named here would carry Fixes: 695176bfe5de, so it won't reach pre-5.15 trees either. For v5.15 and later, the dependency on that companion patch is already stated clearly. Could the commit message mention that the leak is live in stable trees older than v5.15? Otherwise, someone handling a failed-to-apply stable report could drop this fix for 5.10, the one tree where it fixes a bug that can actually be reached.
-- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40intel.com