Article View: linux.kernel.netdev
Article #16994Re: [PATCH net] net: tn40xx: fix swnode use-after-free on probe failure
From: Johan Hovold
Date: Mon, 16 Nov 2026 08:54
Date: Mon, 16 Nov 2026 08:54
31 lines
9196 bytes
9196 bytes
On Thu, Nov 12, 2026 at 10:03:08PM +0000, netdev-bot+sashiko@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 1 potential > issue(s) to consider. > > Critical: 0 · High: 1 · Medium: 0 · Low: 0 > > If you believe none of the issues are legitimate, please reply to each > issue of Medium severity or higher and explain why the AI is wrong. > If any of them are legitimate and you plan to respin, please let patchwork > know by including "pw-bot: cr" as a separate line at the end of your reply > (one such reply per series is enough). > > - [High] The patch rests on a wrong premise and adds a refcount leak of > the MDIO software node, along with a dangling pointer into freed… The bot is indeed right. The driver is dropping a reference taken by another layer and works around a swnode implementation detail. There would still be a reference imbalance, leading to an early release of the parent mdio swnode, if mdio bus registration bails out before taking the reference, but AFAICT that would currently not lead to a UAF either despite what the comment above software_node_unregister_node_group() suggests (I'll fix that up separately). I'll send a follow up to try to make this less subtle and fragile. Johan pw-bot: cr
Technical Details
Message-ID:
<avrEt3hhG9i5hrd2@hovoldconsulting.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364113-linux-kernel-netdev=dewy.ruReferences:
<20261110100051.2567443-1-johan@kernel.org> <179452098811.2199510.15081106290449010908@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364113-linux-kernel-netdev=dewy.ru From: johan@kernel.org (Johan Hovold) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] net: tn40xx: fix swnode use-after-free on probe failure Date: Mon, 16 Nov 2026 09:54:15 +0100 Organization: Usenet Network Message-ID: <avrEt3hhG9i5hrd2@hovoldconsulting.com> References: <20261110100051.2567443-1-johan@kernel.org> <179452098811.2199510.15081106290449010908@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2013751"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:QvJqnqsi0A2raYxbahkMmgQ1ve0= sha256:kubRyZdse8nsr6kiDVDP8okwMTBbsijhGpb7XLA1unA= sha1:PHqdjfA2RAgPx+4TRXwqhlkZNAs= sha256:6jlP3dRsDthT//17xr19YREIIZp0b3jOpMk1sBr4UBk= Content-Disposition: inline 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 7E965114B60; Mon, 16 Nov 2026 11:54:37 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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] 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 pQz9FL1cd-L2; Mon, 16 Nov 2026 11:54:33 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364113-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 0774D114B5D; Mon, 16 Nov 2026 11:54:22 +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 36A482D32D; Mon, 16 Nov 2026 08:54:19 +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=1794819259; b=JZRUyf+cPVOAui8KXlBqnZTuJALvZQtzfHtamIEbWt1shM4oBeH/vFGR6NTsepZDHPMr rT2PlKClzD5LK/UTyBDco3VbtB8oyc7a48/Ec4IlRx2w1SOUr9AN5x7rfjhJaFWVBWMYs JaQVRS3HDQv35goWlzs9RE/USwzo2wpeYt19yIXix7UkKwn6NHgPCeoSbJSWN4DKt9iWV JxPCL3KfD4tAhQkzpAnkQ5mZNYzdRe5Fzk/6MyO2+5h1N2uubbiUO2t5/5HU8Kpwk62fy +iYSmvkPfIUl4b++wgBg0BQOhB8MtIXGrjHteIcblInw0qCpmocEfObU9Wj0nS1z9kQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794819259; h=X-Original-To:Received:Received:DKIM-Signature:Received:Date:From:To: Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=wZJu/F9JcabB87hqeAwvNRzYDaRsgQTCgDWDmmm8eww=; b=wN2CWJqWltTHUTb7EwCbS8+QPHfLd3ALdEMifE1FpOjasZ/leSuF9kkrFg0y7+71y35q tSp7uuTTXoEbGN0Y7GWCjbm3IQbTZhUk0vODlOdvwsoaq6OaUAT9H5a7LsBkrFReiZAof GDQuvkYFWX70OwVnFN17k8WPTJaEfvf7XCXEU2gcJmJqShejMtv3urumI8xO0BR3aw6Kw OqqjLWIrBkOfiWkUhPamf9lzsuJOfvH34AkoHRUr/WelycCJEJ5XcwCC0YEJDDv+vfu7X HFYFAlLE8VfSn/hl33/qKF5OzNpHthpQLdGSy6/ITB1vxKDkoGGi6Mp1agaJ8QELEPQ== 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=ZeAqpjLW; 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 04C45606A335; Mon, 16 Nov 2026 08:54:19 +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=ZeAqpjLW 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=1794819258; b=0wYwHknoPACnHVE03gwMlqR6KSoAfDZoJzQCEoUBN54hihe/aj4LkxAFUAu4qZC/6C8m hlyCsoGqjgJF2IzinZ/OZwdY2UkcC2mbTxrW61fOJ2ZsHBiAcj1k195ZNNAHi5klRfIll oETm9HNc++XrFjFuTh2mJLvl5O4C9QnkQqPWRywndLeA7Ic/M0MEOqjFFBDhIttugmBQ+ XZU59EUV9Uv4zeA5SH56jjQAH56d8aKQo5L1CvUZVA3Ca5MAM12DDww5LUiLuwndRhRsE fL2KXz7iv5/kobtD06C64qBsPogGhkgNyCjMT2JKSBVPv/T7AOcR+NaI4g+caV7nbQw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794819258; h=Received:DKIM-Signature:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=wZJu/F9JcabB87hqeAwvNRzYDaRsgQTCgDWDmmm8eww=; b=LB+s6A/27kjYCbEGcWnHmQ38jaIpisERCS5BfHQGUH2RHNG+IodlUZzPyPz4//sXBhD+ i2Ukau2vXTmjL6c+qPDxZwgEKp9D+3KhkQW4h1TQFRCSII5zmE/Zzsi/raS3aZOs0lAKO AJpk7Uhe/8QbXdFtoiU7BSC12wIqUQD4opZo9JHRwI0TdVI/NEE0RqZl4XZz8DIwSeB44 C4ctC2vSIgkKRN4KXF3PAnYBhDTVH5G/Mz0qmUtUgN7sTtB20Gh88MuF4jhBN03ALTk3X E4vXYOwyy5uJHxWCZ9d/a4K54voNHYb1TIoJEMsC6pOXmbJoHICFgQLYiqo4+9xcz8A== 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=ZeAqpjLW; 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 232C8606A31C; Mon, 16 Nov 2026 08:54:17 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A95AE1F000C4; Mon, 16 Nov 2026 08:54:17 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794819257; bh=wZJu/F9JcabB87hqeAwvNRzYDaRsgQTCgDWDmmm8eww=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=ZeAqpjLWTiHXTS4aceJvRXEjCfcTIhLjjjy6BcPvQdiz1WSK7S+fg8seZpXzj7RkL 8kvb/ATz0COkPyqYl0GJMgOAmblG4zANfigzgvv1SsXIu/iLwY0XMcFLHg15Ulxpj+ SvgB2ABW+aUMivq6pTUKwmODz4goks5i1+n+rvrFsxv6R1PXG7nbjzRiVwsNfA3Af3 1oSzZkb89NRLuoy1qqwxPAudNKbQCQH1Iwxk64p10HxiM5nf8rR0od7ckeerrmZiGA R3G2PgWTURY/Vw6OX/SVaz1PvrO5i0wPEhKuUhYL5zEVFe5Sez3rquA/TsXi51Hbkz aDXyOjWOFVFEA== X-Received: from johan by xi.lan with local (Exim 4.100.1) (envelope-from <johan@kernel.org>) id 1xSsTf-000000033jK-0r2E; Mon, 16 Nov 2026 09:54:15 +0100 X-Cc: fujita.tomonori@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, stable@vger.kernel.org, hfdevel@gmx.net 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 X-In-Reply-To: <179452098811.2199510.15081106290449010908@kernel.org>