Netdev List
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, Johan Hovold <johan@kernel.org>
Subject: [PATCH net-next v2 0/2] net: tn40xx: avoid early firmware node release
Date: Mon, 16 Nov 2026 10:11:47 +0100	[thread overview]
Message-ID: <20261116091149.730586-1-johan@kernel.org> (raw)

The tn40xx driver works around a swnode implementation detail and drops
a firmware node reference it has not taken itself.

The first patch avoids releasing the firmware node prematurely if mdio
bus registration ever bails out before taking the reference, and the
second patch cleans up the implementation by switching to using a
primary software node.

This was something I stumbled over when reviewing the software node
implementation and the series has only been compile tested.

Johan


Changes in v2
 - only drop the fwnode reference if it has been taken
 - amend commit message and explain why this does not lead to a UAF
   currently
 - switch to primary software node (2/2, new patch)

 v1: https://lore.kernel.org/all/20261110100051.2567443-1-johan@kernel.org/


Johan Hovold (2):
  net: tn40xx: avoid early firmware node release
  net: tn40xx: switch to primary software node

 drivers/net/ethernet/tehuti/tn40_mdio.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

-- 
2.56.1


             reply	other threads:[~2026-11-16  9:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  9:11 Johan Hovold [this message]
2026-11-16  9:11 ` [PATCH net-next v2 1/2] net: tn40xx: avoid early firmware node release Johan Hovold
2026-11-16  9:11 ` [PATCH net-next v2 2/2] net: tn40xx: switch to primary software node Johan Hovold

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=20261116091149.730586-1-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=fujita.tomonori@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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