Skip to content
Commit 1d80c259 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Greg Kroah-Hartman
Browse files

net: mdio: validate parameter addr in mdiobus_get_phy()

[ Upstream commit 867dbe78 ]

The caller may pass any value as addr, what may result in an out-of-bounds
access to array mdio_map. One existing case is stmmac_init_phy() that
may pass -1 as addr. Therefore validate addr before using it.

Fixes: 7f854420

 ("phy: Add API for {un}registering an mdio device to a bus.")
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/cdf664ea-3312-e915-73f8-021678d08887@gmail.com
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 72ce5c09
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment