Thread (2 messages) flat view 2 messages, 2 authors, 2021-10-04

Re: [PATCH RFT v2 net-next] net: mdio: ensure the type of mdio devices match mdio drivers

From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-10-04 12:00:55

On Fri, Oct 01, 2021 at 11:00:41AM +0100, Russell King (Oracle) wrote:
On the MDIO bus, we have PHYLIB devices and drivers, and we have non-
PHYLIB devices and drivers. PHYLIB devices are MDIO devices that are
wrapped with a struct phy_device.

Trying to bind a MDIO device with a PHYLIB driver results in out-of-
bounds accesses as we attempt to access struct phy_device members. So,
let's prevent this by ensuring that the type of the MDIO device
(indicated by the MDIO_DEVICE_FLAG_PHY flag) matches the type of the
MDIO driver (indicated by the MDIO_DEVICE_IS_PHY flag.)

Link: https://lore.kernel.org/r/2b1dc053-8c9a-e3e4-b450-eecdfca3fe16@gmail.com (local)
Signed-off-by: Russell King (Oracle) <redacted>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help