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: <86wmkkz7un.wl-maz@kernel.org>
Date: Tue, 13 Aug 2024 17:49:04 +0100
From: Marc Zyngier <maz@...nel.org>
To: Breno Leitao <leitao@...ian.org>
Cc: linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org,
	Sunil Goutham <sgoutham@...vell.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net] net: thunder_bgx: Fix netdev structure allocation

On Tue, 13 Aug 2024 17:25:27 +0100,
Breno Leitao <leitao@...ian.org> wrote:
> 
> Hello Marc,
> 
> On Mon, Aug 12, 2024 at 03:13:22PM +0100, Marc Zyngier wrote:
> > Commit 94833addfaba ("net: thunderx: Unembed netdev structure") had
> > a go at dynamically allocating the netdev structures for the thunderx_bgx
> > driver.  This change results in my ThunderX box catching fire (to be fair,
> > it is what it does best).
> 
> Should I be proud of it? :-)

It's always good practice to check that someone still cares about
terrible HW. Break it, wait for a few releases, and purge it if nobody
was looking.

Unfortunately, this is one of the few machines I have that has 16kB
page support, so I can't really turn a blind eye on the
breakage... ;-)

> 
> > The issues with this change are that:
> > 
> > - bgx_lmac_enable() is called *after* bgx_acpi_register_phy() and
> >   bgx_init_of_phy(), both expecting netdev to be a valid pointer.
> > 
> > - bgx_init_of_phy() populates the MAC addresses for *all* LMACs
> >   attached to a given BGX instance, and thus needs netdev for each of
> >   them to have been allocated.
> > 
> > There is a few things to be said about how the driver mixes LMAC and
> > BGX states which leads to this sorry state, but that's beside the point.
> > 
> > To address this, go back to a situation where all netdev structures
> > are allocated before the driver starts relying on them, and move the
> > freeing of these structures to driver removal. Someone brave enough
> > can always go and restructure the driver if they want.
> > 
> > Fixes: 94833addfaba ("net: thunderx: Unembed netdev structure")
> > Signed-off-by: Marc Zyngier <maz@...nel.org>
> 
> Reviewed-by: Breno Leitao <leitao@...ian.org>
> 
> Thanks for taming my fiery commit.

No worries.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ