]> git.baikalelectronics.ru Git - kernel.git/commit
phy: phy_ethtool_ksettings_set: Lock the PHY while changing settings
authorAndrew Lunn <andrew@lunn.ch>
Sun, 24 Oct 2021 19:48:05 +0000 (21:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Oct 2021 13:06:43 +0000 (14:06 +0100)
commit4019f4687be3f6978291e68fa197f42876057789
treee527db05dce25d753a20424239054648169bcca5
parent4d982c75ec60fc15612dcb50b25bafc23e3c09fd
phy: phy_ethtool_ksettings_set: Lock the PHY while changing settings

There is a race condition where the PHY state machine can change
members of the phydev structure at the same time userspace requests a
change via ethtool. To prevent this, have phy_ethtool_ksettings_set
take the PHY lock.

Fixes: b8d3899eefb1 ("phy: add generic function to support ksetting support")
Reported-by: Walter Stoll <Walter.Stoll@duagon.com>
Suggested-by: Walter Stoll <Walter.Stoll@duagon.com>
Tested-by: Walter Stoll <Walter.Stoll@duagon.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c