diff options
author | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2015-01-16 20:51:25 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-11 19:30:10 +0300 |
commit | 62e841cdbbf107863bd572aad893300b33d031fa (patch) | |
tree | 7169b0624b08dd8eab571e1fd4afc9002638dc81 /net/sched | |
parent | 0c59f879ba5ef8b7a0f36f66f14e10167c82ffe2 (diff) | |
download | linux-62e841cdbbf107863bd572aad893300b33d031fa.tar.xz |
sh_eth: Fix ethtool operation crash when net device is down
commit 4f9dce230b32eec45cec8c28cae61efdfa2f7d57 upstream.
The driver connects and disconnects the PHY device whenever the
net device is brought up and down. The ethtool get_settings,
set_settings and nway_reset operations will dereference a null
or dangling pointer if called while it is down.
I think it would be preferable to keep the PHY connected, but there
may be good reasons not to.
As an immediate fix for this bug:
- Set the phydev pointer to NULL after disconnecting the PHY
- Change those three operations to return -ENODEV while the PHY is
not connected
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sched')
0 files changed, 0 insertions, 0 deletions