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: <a520ee4da331c8edb99f2c14d22a3531@manjaro.org>
Date: Sun, 28 Jul 2024 16:10:57 +0200
From: Dragan Simic <dsimic@...jaro.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: Jose Ignacio Tornos Martinez <jtornosm@...hat.com>,
 UNGLinuxDriver@...rochip.com, davem@...emloft.net, edumazet@...gle.com,
 f.fainelli@...il.com, gregkh@...uxfoundation.org, kuba@...nel.org,
 linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-usb@...r.kernel.org, lucas.demarchi@...el.com, masahiroy@...nel.org,
 mcgrof@...nel.org, netdev@...r.kernel.org, pabeni@...hat.com,
 woojung.huh@...rochip.com
Subject: Re: [PATCH] net: usb: lan78xx: add weak dependency with micrel phy
 module

Hello Andrew,

On 2024-07-28 01:29, Andrew Lunn wrote:
>> Before going into explaining my viewpoint, could someone, please, 
>> clarify
>> which LAN78xx USB-to-Ethernet bridge does this apply to?  I already 
>> had
>> a look at a few LAN78xx datasheets, and I'm not sure how the external 
>> PHY
>> becomes exposed over the USB interface, so it needs a driver.
> 
> https://elixir.bootlin.com/linux/v6.10/source/drivers/net/usb/lan78xx.c#L2049
> 
> This is creating an MDIO bus device. The MDIO bus will be scanned and
> PHYs on the bus found. There are then a few calls to phy_find_first()
> which will get the PHY.
> 
> The code itself looks pretty broken, it is directly accessing PHY
> registers, which a MAC driver should not do. That is a layering
> violation.

Thanks for the clarification.

Basically, the way I see it, weakdeps are the right solution for the
problem at hand, i.e. for the generation of the initial ramdisk with
all the possible PHY driver modules.  However, I don't think that some
automagical generation of the associated MODULE_WEAKDEP() statements
is the way to go.  Instead, all those statements should be added by
hand to the lan78xx driver, making sure that each PHY is tested and
validated beforehand.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ