From 184e5c7db114af9d5cae2c4687f23de8418ba8b7 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 10 Aug 2017 09:18:10 -0700 Subject: [PATCH] 3.18-stable patches added patches: net-phy-fix-phy-unbind-crash.patch --- queue-3.18/net-phy-fix-phy-unbind-crash.patch | 35 +++++++++++++++++++ queue-3.18/series | 1 + 2 files changed, 36 insertions(+) create mode 100644 queue-3.18/net-phy-fix-phy-unbind-crash.patch diff --git a/queue-3.18/net-phy-fix-phy-unbind-crash.patch b/queue-3.18/net-phy-fix-phy-unbind-crash.patch new file mode 100644 index 00000000000..5cbe3f6dbbf --- /dev/null +++ b/queue-3.18/net-phy-fix-phy-unbind-crash.patch @@ -0,0 +1,35 @@ +From 7b9a88a390dacb37b051a7b09b9a08f546edf5eb Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Fri, 17 Feb 2017 16:07:33 -0800 +Subject: net: phy: Fix PHY unbind crash + +From: Florian Fainelli + +commit 7b9a88a390dacb37b051a7b09b9a08f546edf5eb upstream. + +The PHY library does not deal very well with bind and unbind events. The first +thing we would see is that we were not properly canceling the PHY state machine +workqueue, so we would be crashing while dereferencing phydev->drv since there +is no driver attached anymore. + +Suggested-by: Russell King +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/phy/phy_device.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/phy/phy_device.c ++++ b/drivers/net/phy/phy_device.c +@@ -1267,6 +1267,8 @@ static int phy_remove(struct device *dev + { + struct phy_device *phydev = to_phy_device(dev); + ++ cancel_delayed_work_sync(&phydev->state_queue); ++ + mutex_lock(&phydev->lock); + phydev->state = PHY_DOWN; + mutex_unlock(&phydev->lock); diff --git a/queue-3.18/series b/queue-3.18/series index 127ce60e2d2..bbfa717530f 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -90,3 +90,4 @@ lib-kconfig.debug-fix-frv-build-failure.patch signal-protect-signal_unkillable-from-unintentional-clearing.patch mm-don-t-dereference-struct-page-fields-of-invalid-pages.patch ipv4-should-use-consistent-conditional-judgement-for-ip-fragment-in-__ip_append_data-and-ip_finish_output.patch +net-phy-fix-phy-unbind-crash.patch -- 2.47.3