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
| ||
|
Message-ID: <20220720135314.5cjxiifrq5ig4vjb@skbuf> Date: Wed, 20 Jul 2022 16:53:14 +0300 From: Vladimir Oltean <olteanv@...il.com> To: Sean Anderson <sean.anderson@...o.com> Cc: Heiner Kallweit <hkallweit1@...il.com>, Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>, Madalin Bucur <madalin.bucur@....com>, "David S . Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>, Ioana Ciornei <ioana.ciornei@....com>, linux-kernel@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>, Andrew Lunn <andrew@...n.ch>, Alexandre Belloni <alexandre.belloni@...tlin.com>, Benjamin Herrenschmidt <benh@...nel.crashing.org>, Claudiu Manoil <claudiu.manoil@....com>, Florian Fainelli <f.fainelli@...il.com>, Frank Rowand <frowand.list@...il.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Li Yang <leoyang.li@....com>, Michael Ellerman <mpe@...erman.id.au>, Paul Mackerras <paulus@...ba.org>, Rob Herring <robh+dt@...nel.org>, Saravana Kannan <saravanak@...gle.com>, Shawn Guo <shawnguo@...nel.org>, UNGLinuxDriver@...rochip.com, Vivien Didelot <vivien.didelot@...il.com>, Vladimir Oltean <vladimir.oltean@....com>, devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, linuxppc-dev@...ts.ozlabs.org Subject: Re: [RFC PATCH net-next 0/9] net: pcs: Add support for devices probed in the "usual" manner On Tue, Jul 19, 2022 at 03:34:45PM -0400, Sean Anderson wrote: > We could do it, but it'd be a pretty big hack. Something like the > following. Phylink would need to be modified to grab the lock before > every op and check if the PCS is dead or not. This is of course still > not optimal, since there's no way to re-attach a PCS once it goes away. You assume it's just phylink who operates on a PCS structure, but if you include your search pool to also cover include/linux/pcs/pcs-xpcs.h, you'll see a bunch of exported functions which are called directly by the client drivers (stmmac, sja1105). At this stage it gets pretty hard to validate that drivers won't attempt from any code path to do something stupid with a dead PCS. All in all it creates an environment with insanely weak guarantees; that's pretty hard to get behind IMO. > IMO a better solution is to use devlink and submit a patch to add > notifications which the MAC driver can register for. That way it can > find out when the PCS goes away and potentially do something about it > (or just let itself get removed). Not sure I understand what connection there is between devlink (device links) and PCS {de}registration notifications. We could probably add those notifications without any intervention from the device core: we would just need to make this new PCS "core" to register an blocking_notifier_call_chain to which interested drivers could add their notifier blocks. How a certain phylink user is going to determine that "hey, this PCS is definitely mine and I can use it" is an open question. In any case, my expectation is that we have a notifier chain, we can at least continue operating (avoid unbinding the struct device), but essentially move our phylink_create/phylink_destroy calls to within those notifier blocks. Again, retrofitting this model to existing drivers, phylink API (and maybe even its internal structure) is something that's hard to hop on board of; I think it's a solution waiting for a problem, and I don't have an interest to develop or even review it.
Powered by blists - more mailing lists