Russell King (Oracle) 94114d9003 net: mdio: ensure the type of mdio devices match mdio drivers
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
Tested-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-10-08 15:20:45 +01:00
..
2021-09-07 12:38:59 -07:00
2021-09-09 11:48:27 -07:00
2021-09-09 11:39:57 -07:00
2021-09-08 11:50:26 -07:00
2021-09-09 11:07:47 -07:00
2021-10-07 21:14:04 +02:00
2021-09-30 12:11:35 -07:00
2021-09-15 17:18:56 -07:00
2021-09-02 13:49:39 -07:00
2021-09-03 15:33:47 -07:00
2021-09-27 13:05:12 -07:00
2021-09-01 08:44:42 -07:00
2021-09-07 12:38:59 -07:00
2021-10-07 13:35:10 +01:00
2021-10-07 13:39:51 +01:00
2021-10-07 09:44:48 -07:00
2021-09-20 12:43:34 +01:00
2021-09-01 15:25:28 -07:00
2021-09-01 08:44:42 -07:00
2021-10-07 21:13:57 +02:00
2021-09-01 10:29:29 -07:00
2021-09-22 11:58:24 -07:00
2021-09-14 11:18:47 +02:00
2021-10-07 14:01:29 -07:00
2021-09-28 07:27:29 -07:00
2021-09-18 11:15:01 -07:00
2021-09-25 15:37:31 -07:00
2021-08-14 15:54:09 -06:00
2021-08-14 15:54:09 -06:00