Article View: linux.kernel.netdev
Article #26963Re: [PATCH net v4 2/5] net/sched: cls_u32: remove erroneous refcount_inc()
From: netdev-bot+sashiko
Date: Fri, 04 Dec 2026 14:02
Date: Fri, 04 Dec 2026 14:02
64 lines
10487 bytes
10487 bytes
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
Technical Details
Message-ID:
<179639296014.3146.10241070479974790312@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377398-linux-kernel-netdev=dewy.ruReferences:
<20261203124056.547555-3-jedrzej.jagielski@intel.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377398-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v4 2/5] net/sched: cls_u32: remove erroneous refcount_inc() Date: Fri, 04 Dec 2026 14:02:40 +0000 Organization: Usenet Network Message-ID: <179639296014.3146.10241070479974790312@kernel.org> References: <20261203124056.547555-3-jedrzej.jagielski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2778501"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:1DLpOwHOqS8WYc+g2wwFcTTQZzk= sha256:lnfyuSgoaET0w/6gnzs+SbOLBlcHddgQ/ivnIsFUpJs= sha1:5K+k2rO1cDTrFeU5R8lSJGQkyKg= sha256:xKELFLpvAnOyQSig+P7hkv0Qr4NpdEVl7gl3niEhWKE= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id D3D3C117C17; Fri, 4 Dec 2026 17:03:07 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.541 X-Spam-Status: No, score=-3.541 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fmte5e-WdDcO; Fri, 4 Dec 2026 17:03:00 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377398-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 7BF00117BBC; Fri, 4 Dec 2026 17:02:47 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 95B32A07F1; Fri, 4 Dec 2026 14:02:42 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796392962; b=O4WlKCTn84iuOldSsRN26fstXLnpjEmAVIOyeeIpr6tWDUIQiO/U0X1R3u0aBWWlJEJy UgWyCadmyTMnEoBUfCKhryDMhq7yyXWlS7Z5cKChEn2F3Ryjwt1a9RMQXj1fIi29pJWL7 cpiYcJWr/8PjZI6NFk9+zqnCanQlWOfaoemi2xP5uhsFWC+4kqG0dpbnml87Swf+bmKxZ IL25Zfa9s4eMMu+qkINlkabGqCR4rFskUiZtjpRTcKzRfh3QVSMc9zU56ugstc4q4qvzN WEvHGJXP9fZH4u1zhuCCpjHgHwW65jf9EZmFd7F10RbkDKwycRguuTqhSyYAHKDHF+w== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796392962; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=x1Z0vCI6vWvnV2rQQ2M6tenE57iAHev1R24DlpDr0Sg=; b=keR5lrIz652hMrjIjAhA3ywx0PkgVNivuxMnOnwHFrADfoJuLGWwCPAMEdoIDckJ63hx TnXS5t4o67xg9V0xVUJaZRcPXwHe/3mtzAendx4TSmYAgk/H1Jc7nWnVkG7z4X12YeV8C koUAB4vnMsGY+8kPxY8C5pNgYE/GlleYklGthhG1Dn7A4G5IyzQ1on1zZqSFWjnom0TnO XwrcGaSz6WvN/vEpKX8QOF6oIA2vuzc42dGyI/Y2o8BtjUtpuOFtRa2vxeY8Q5zPQQUHP DPVfWPFhdSWii1HoTQkwAFfWnuFlm7SD0NkkSYKS4MeWfQRbiwOTyuOvg0c+Vlgh3VA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PtyYTqpi; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 422E9606A336; Fri, 4 Dec 2026 14:02:42 +0000 (UTC) X-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=PtyYTqpi X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796392961; b=ipNRgtP3ND9ML6bQppMmSclOSSRsT1S4+l083khPjYJ285KqjLUQnNvZ6Q9w4+1WjRZC /oWeyZfApaGDI9FSzC18qI1d8Q2yLifNsGZYTkOwqP/catIidZ1smdrekNe0xeNuaxH9d 2rgDnYqzd2EtoQavCoWynj4MB/bwxPjLn2eTOmUABQqUnIQitKMkoetpxX4O6yKznH/9X Swunauspri4jMk+dWsNt7lMSXktrkJHYgSKtMs5LSFGJmr2wcceVSxeaxavUHVkOfgiMW T+vC9hDillEeEbp5RdxulEr8L2YkbLA+Zof1ELdLnQ7xoS3VOR7NBSm9JyDI5vT4c1A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796392961; 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=x1Z0vCI6vWvnV2rQQ2M6tenE57iAHev1R24DlpDr0Sg=; b=WdD7VpVsPYDP+BHG9gxQQZsFC9Q/VuHATcSKd9GxVKmXk485ga1WZVh6sFn4qXdd2MJq 0jVanT3eGgznev85JOzwSPRAZBWJlTR6cApTDHKPjTs6Vw5HwxGDUuBH8Sk7NfDF0pIsG xReINKPNO+KX+9vX0pr0oB80dKGKLxdQPh7jguEDqQhQA7168AR4tBJNolaptbD1OU3Xf hUcf29nwlon2/XmCU97k76161TqWymzFK2uYwUgooq4iHmeHv+VTZp/fA+EdFQUVLrVoS 8SZ654ARTQ0Wo067zOysb2HqpArJJJOJXmucoEIb+RG7z2EI2u2//2eWb4iKP7pPfog== X-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=PtyYTqpi; arc=none smtp.remote-ip=100.103.45.18 X-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 5FB2D606A32D for <netdev@vger.kernel.org>; Fri, 4 Dec 2026 14:02:41 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E3291F000CE; Fri, 4 Dec 2026 14:02:40 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796392961; bh=x1Z0vCI6vWvnV2rQQ2M6tenE57iAHev1R24DlpDr0Sg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=PtyYTqpi9NNK/b2KZcC0p/iA/AvHkLU+SHXL5BwjCIJ5JJEjc/7Fueben8pRtd40/ fFkDO/5S9Goh7abN1gXbKFS39O4/3pA2Ojtdrp/en06l8yBBmvhrYzQEvYrDqVGQwR rZ3d8prUBIO3Bxp07/FoKOBHnR3szcVnqv8lNeSz1uEZcgp4dQ+5rz7cyIqoQ7B8qs pt3VtAzmc7MkEYHTXf6iOiySWuUAedrSSSWVMV8Z5dUI2jydHb+V2hW03zSeDpHKzB ptIL+mamC11DEyk7sAgKplZUnaRyJxG4B4Ft1+PQewU+q2p/fU+lCeDsOAufX6yJxg vJZMEt9bD/9tQ== X-Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com, kuba@kernel.org, jhs@mojatatu.com, jiri@resnulli.us, edumazet@google.com X-In-Reply-To: <20261203124056.547555-3-jedrzej.jagielski@intel.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list