]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Aug 2017 16:18:20 +0000 (09:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Aug 2017 16:18:20 +0000 (09:18 -0700)
added patches:
net-phy-fix-phy-unbind-crash.patch

queue-4.4/net-phy-fix-phy-unbind-crash.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/net-phy-fix-phy-unbind-crash.patch b/queue-4.4/net-phy-fix-phy-unbind-crash.patch
new file mode 100644 (file)
index 0000000..89c1a79
--- /dev/null
@@ -0,0 +1,35 @@
+From 7b9a88a390dacb37b051a7b09b9a08f546edf5eb Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Fri, 17 Feb 2017 16:07:33 -0800
+Subject: net: phy: Fix PHY unbind crash
+
+From: Florian Fainelli <f.fainelli@gmail.com>
+
+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 <rmk+kernel@armlinux.org.uk>
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -1368,6 +1368,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);
index 165866031152c911a41cfbf918e6d69dfea86d91..4aa2f770e2a270d0a480bb7a72dcb8c928b18154 100644 (file)
@@ -37,6 +37,7 @@ sctp-don-t-dereference-ptr-before-leaving-_sctp_walk_-params-errors.patch
 sctp-fix-the-check-for-_sctp_walk_params-and-_sctp_walk_errors.patch
 net-mlx5-fix-command-bad-flow-on-command-entry-allocation-failure.patch
 net-phy-correctly-process-phy_halted-in-phy_stop_machine.patch
+net-phy-fix-phy-unbind-crash.patch
 xen-netback-correctly-schedule-rate-limited-queues.patch
 sparc64-measure-receiver-forward-progress-to-avoid-send-mondo-timeout.patch
 sparc64-prevent-perf-from-running-during-super-critical-sections.patch