OpenCloudOS-Kernel/net/ethtool
Michal Kubecek 2f599ec422 ethtool: fix reference leak in some *_SET handlers
Andrew noticed that some handlers for *_SET commands leak a netdev
reference if required ethtool_ops callbacks do not exist. A simple
reproducer would be e.g.

  ip link add veth1 type veth peer name veth2
  ethtool -s veth1 wol g
  ip link del veth1

Make sure dev_put() is called when ethtool_ops check fails.

v2: add Fixes tags

Fixes: a53f3d41e4 ("ethtool: set link settings with LINKINFO_SET request")
Fixes: bfbcfe2032 ("ethtool: set link modes related data with LINKMODES_SET request")
Fixes: e54d04e3af ("ethtool: set message mask with DEBUG_SET request")
Fixes: 8d425b19b3 ("ethtool: set wake-on-lan settings with WOL_SET request")
Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-23 21:50:14 -07:00
..
Makefile ethtool: provide WoL settings with WOL_GET request 2020-01-27 11:31:36 +01:00
bitset.c ethtool: limit bitset size 2020-02-26 11:27:31 -08:00
bitset.h ethtool: limit bitset size 2020-02-26 11:27:31 -08:00
common.c ethtool: provide WoL settings with WOL_GET request 2020-01-27 11:31:36 +01:00
common.h ethtool: provide WoL settings with WOL_GET request 2020-01-27 11:31:36 +01:00
debug.c ethtool: fix reference leak in some *_SET handlers 2020-03-23 21:50:14 -07:00
ioctl.c net/core: Replace driver version to be kernel version 2020-01-27 13:47:22 +01:00
linkinfo.c ethtool: fix reference leak in some *_SET handlers 2020-03-23 21:50:14 -07:00
linkmodes.c ethtool: fix reference leak in some *_SET handlers 2020-03-23 21:50:14 -07:00
linkstate.c ethtool: provide link state with LINKSTATE_GET request 2019-12-27 16:40:02 -08:00
netlink.c ethtool: reject unrecognized request flags 2020-03-16 02:04:24 -07:00
netlink.h ethtool: set wake-on-lan settings with WOL_SET request 2020-01-27 11:31:36 +01:00
strset.c ethtool: provide WoL settings with WOL_GET request 2020-01-27 11:31:36 +01:00
wol.c ethtool: fix reference leak in some *_SET handlers 2020-03-23 21:50:14 -07:00