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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250121085045.480c2e51@pumpkin>
Date: Tue, 21 Jan 2025 08:50:45 +0000
From: David Laight <david.laight.linux@...il.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net,
 netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
 andrew+netdev@...n.ch, horms@...nel.org, jdamato@...tly.com, Francois
 Romieu <romieu@...zoreil.com>, pcnet32@...ntier.com,
 anthony.l.nguyen@...el.com, przemyslaw.kitszel@...el.com,
 marcin.s.wojtas@...il.com
Subject: Re: [PATCH net-next v2 06/11] net: protect NAPI enablement with
 netdev_lock()

On Tue, 21 Jan 2025 11:32:24 +0300
Dan Carpenter <dan.carpenter@...aro.org> wrote:

> On Tue, Jan 14, 2025 at 07:53:14PM -0800, Jakub Kicinski wrote:
> > Wrap napi_enable() / napi_disable() with netdev_lock().
> > Provide the "already locked" flavor of the API.
> > 
> > iavf needs the usual adjustment. A number of drivers call
> > napi_enable() under a spin lock, so they have to be modified
> > to take netdev_lock() first, then spin lock then call
> > napi_enable_locked().  
> 
> You missed some.
> 
> drivers/net/ethernet/broadcom/tg3.c:7427 tg3_napi_enable() warn: sleeping in atomic context
> drivers/net/ethernet/nvidia/forcedeth.c:5597 nv_open() warn: sleeping in atomic context
...

Looks like the whole patch is very fragile.
You really need to keep the existing function names having their existing semantics.
Add a new function, change all the code, then delete the old function.

It also looks as though drivers will end up holding netdev_lock() for long
periods just so they can do a napi_enable() much later on.

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ