diff options
author | Maxime Chevallier <maxime.chevallier@bootlin.com> | 2024-09-13 12:05:14 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-09-14 06:40:12 +0200 |
commit | 1ad84a151af7f4b3933983677bc75074f957bdf5 (patch) | |
tree | 7117c56776c532445f72a32f812108428114da9e /net/ethtool | |
parent | Merge tag 'linux-can-next-for-6.12-20240911' of git://git.kernel.org/pub/scm/... (diff) | |
download | linux-1ad84a151af7f4b3933983677bc75074f957bdf5.tar.xz linux-1ad84a151af7f4b3933983677bc75074f957bdf5.zip |
net: ethtool: phy: Don't set the context dev pointer for unfiltered DUMP
The context info allows continuing DUMP requests, shall they fill the
netlink buffer.
In the case of filtered DUMP requests, a reference on the netdev is
grabbed in the .start() callback and release in .done().
Unfiltered DUMP request don't need the dev pointer to be set in the context
info, doing so will trigger an unwanted netdev_put() in .done().
Reported-by: syzbot+e9ed4e4368d450c8f9db@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/000000000000d3bf150621d361a7@google.com/
Fixes: 17194be4c8e1 ("net: ethtool: Introduce a command to list PHYs on an interface")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20240913100515.167341-1-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ethtool')
-rw-r--r-- | net/ethtool/phy.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/net/ethtool/phy.c b/net/ethtool/phy.c index 4ef7c6e32d10..ed8f690f6bac 100644 --- a/net/ethtool/phy.c +++ b/net/ethtool/phy.c @@ -251,8 +251,6 @@ static int ethnl_phy_dump_one_dev(struct sk_buff *skb, struct net_device *dev, int ret = 0; void *ehdr; - pri->base.dev = dev; - if (!dev->link_topo) return 0; |