linux-stable/net/ethtool
Michal Kubecek b51fb7711a ethtool: fix reference leak in ethnl_set_privflags()
Andrew noticed that some handlers for *_SET commands leak a netdev
reference if required ethtool_ops callbacks do not exist. One of them is
ethnl_set_privflags(), a simple reproducer would be e.g.

  ip link add veth1 type veth peer name veth2
  ethtool --set-priv-flags veth1 foo on
  ip link del veth1

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

Fixes: f265d79959 ("ethtool: set device private flags with PRIVFLAGS_SET request")
Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-29 22:32:36 -07:00
..
bitset.c ethtool: add ethnl_parse_bitset() helper 2020-03-12 15:32:32 -07:00
bitset.h ethtool: add ethnl_parse_bitset() helper 2020-03-12 15:32:32 -07:00
channels.c ethtool: fix spelling mistake "exceeeds" -> "exceeds" 2020-03-13 11:23:33 -07:00
common.c net: introduce the MACSEC netdev feature 2020-03-26 20:17:36 -07:00
common.h ethtool: set device channel counts with CHANNELS_SET request 2020-03-12 15:32:33 -07:00
debug.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-25 18:58:11 -07:00
features.c ethtool: add FEATURES_NTF notification 2020-03-12 15:32:33 -07:00
ioctl.c ethtool: fix incorrect tx-checksumming settings reporting 2020-03-24 16:25:11 -07:00
linkinfo.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-25 18:58:11 -07:00
linkmodes.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-25 18:58:11 -07:00
linkstate.c ethtool: provide link state with LINKSTATE_GET request 2019-12-27 16:40:02 -08:00
Makefile ethtool: provide channel counts with CHANNELS_GET request 2020-03-12 15:32:33 -07:00
netlink.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-25 18:58:11 -07:00
netlink.h ethtool: set device channel counts with CHANNELS_SET request 2020-03-12 15:32:33 -07:00
privflags.c ethtool: fix reference leak in ethnl_set_privflags() 2020-03-29 22:32:36 -07:00
rings.c ethtool: fix spelling mistake "exceeeds" -> "exceeds" 2020-03-13 11:23:33 -07:00
strset.c ethtool: provide WoL settings with WOL_GET request 2020-01-27 11:31:36 +01:00
wol.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-25 18:58:11 -07:00