Re: [PATCH net] net: tn40xx: fix swnode use-after-free on probe failure

From
Johan Hovold <johan@kernel.org>
Date
2026-11-16 08:54:17
Also in
stable
Reply to
netdev-bot+sashiko@kernel.org, 2026-11-12
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
Thread (6 messages) 6 messages, 4 authors, last reply 1d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help