lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aF0edQRJAXSps5CV@pengutronix.de>
Date: Thu, 26 Jun 2025 12:18:29 +0200
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Woojung Huh <woojung.huh@...rochip.com>,
	Simon Horman <horms@...nel.org>,
	Thangaraj Samynathan <Thangaraj.S@...rochip.com>,
	netdev@...r.kernel.org, Phil Elwell <phil@...pberrypi.org>,
	Russell King <rmk+kernel@...linux.org.uk>,
	linux-kernel@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>,
	Eric Dumazet <edumazet@...gle.com>, kernel@...gutronix.de,
	Rengarajan Sundararajan <Rengarajan.S@...rochip.com>,
	Maxime Chevallier <maxime.chevallier@...tlin.com>,
	Paolo Abeni <pabeni@...hat.com>,
	"David S. Miller" <davem@...emloft.net>,
	UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH net-next v1 1/1] net: usb: lan78xx: fix WARN in
 __netif_napi_del_locked on disconnect

On Mon, Jun 23, 2025 at 04:55:37PM -0700, Jakub Kicinski wrote:
> On Fri, 20 Jun 2025 10:51:44 +0200 Oleksij Rempel wrote:
> > A WARN may be triggered in __netif_napi_del_locked() during USB device
> > disconnect:
> > 
> >   WARNING: CPU: 0 PID: 11 at net/core/dev.c:7417 __netif_napi_del_locked+0x2b4/0x350
> > 
> > This occurs because NAPI remains enabled when the device is unplugged and
> > teardown begins. While `napi_disable()` was previously called in the
> > `lan78xx_stop()` path, that function is not invoked on disconnect. Instead,
> > when using PHYLINK, the `mac_link_down()` callback is guaranteed to run
> > during disconnect, making it the correct place to disable NAPI.
> > 
> > Similarly, move `napi_enable()` to `mac_link_up()` to pair the lifecycle
> > with actual MAC state.
> 
> Stopping and starting NAPI on link events is pretty unusual.
> The problem is the disconnect handling, unregistering netdev
> removes the NAPIs automatically, I think all you need is to
> remove the explicit netif_napi_del() in lan78xx_disconnect().
> Core will call _stop (which disables the NAPI), and then
> it will del the NAPI.

ack.

> > This patch is intended for `net-next` since the issue existed before the
> > PHYLINK migration, but is more naturally and cleanly addressed now that
> > PHYLINK manages link state transitions.
> 
> And repost that for net, please.. :)

It will be not compatible with the PHYlink migration patch in the
net-next. Should i wait until PHYlink patch goes to the net and then
send different patch variants for stable before PHYlink migration and
after?

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ