From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796129687; b=EUp2WnxNCB/u/N3fd+h99YUaL1mze6huhrYBNvpajihSoHriSLSLSfzHZnS8sYmHu6tK bhX+dOpXJlyb6cEL9YaOVvB1SsDfUyNAp0xFUlkLmu3D8wfZX5a2vt8fRC2827UarTGcd LNWrmg2oM/gGYWaAgOqz0jO4gobfCMn0JZFOhNOwqYKhxwNIgQDM6x+MvhYzuNbAZguqw 21s0FaQ5l2a6Iyif2wELx3lxkqO9IP+08a2wG1JlDNMp04mZxna3GxFVg9sL81+JSimdT VrAKmn/WYQIRtY4CJbuHvgv5W4yLxgjW+aqktGAqfh+Y55ynaa+2ByFl0gpA0YSpliA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796129687; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=IdRotYTQj4b4sEyd/qvmk0KwjMLzg9vj+UPhIRPAAP0=; b=fz2kXM7MnVKqkzgnVR8SitMiQS4nCU+MBq4IyqPfjz2aw55lJyE/HtevHcJAhPkq+Ooi 51xhhWnNRm9KmY+pfHwlOc0i2mX82ga/b3Pl5PR1vINyOiADp/J0MQr9fMT+sS6kbrb/M r3p+Gz7UQyoUXg4OxZ+Q4Kkl2JoTTMC/H45aYdaomQva0ytXQX2Vr4NtBqWnnzSVfSt16 BELrKPjZjya76qnylPC10pm43xEI6iQCoxzkg0mLx/J4S1MdelU/2ThCpF2zki0Xj8Q7O oah1XfbUDfPho796FMIAIjSUk0vFL7otyn7z961r1fiqJITti5CcvelQs6Tn7rvzlnw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VqUGi5ut; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9F4F606A31A; Tue, 1 Dec 2026 12:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VqUGi5ut Received: by smtp.kernel.org (Postfix) with ESMTPSA id E566E1F00893; Tue, 1 Dec 2026 12:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796129687; bh=IdRotYTQj4b4sEyd/qvmk0KwjMLzg9vj+UPhIRPAAP0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=VqUGi5utNrZopracZUwWbL/rHpyfIVHGCkAFsVK/S6gXlAV/kskVr6Cx2xCyRpkJt JMedk1XA1jitxqBzydtlbfz2SipI973jLtf6/sdSZtNTOpQBY+OMtdssxNMLuo7sAy 37wHC0cFKaDwDfJQi7aTF7ijo3w2Zw+/yulBRbzGdLgZcmizuzhwnFlJKT3g5UP6Sd rSSTaUF1nUrpK6rqpqaTZYMD3FHdwPitD4norzs0m9mCdpxS3cqnRIBKprCBv3i5dr tGfaNhYBAEhEyjeOf+zsjmuWVUePDSWZroIgHBw2Oxs8Bn6y6poK5N688wgtuPOTTV LmyoJxEeNil9Q== Subject: Re: [PATCH net v3 1/5] net/sched: cls_u32: fix linked hash table refcount leak 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, stable@vger.kernel.org, sashiko-bot@kernel.org Date: Tue, 01 Dec 2026 12:54:46 +0000 Message-ID: <179612968645.3146.10471010351182445151@kernel.org> In-Reply-To: <20261130123028.516696-2-jedrzej.jagielski@intel.com> References: <20261130123028.516696-2-jedrzej.jagielski@intel.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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: stable@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/20261130123028.516696-1-jedrzej.jagielski%40intel.com