Re: [PATCH net] ethtool: fix reference leak in some *_SET handlers

From: Michal Kubecek
Date: Sun Mar 22 2020 - 17:25:12 EST


On Sun, Mar 22, 2020 at 02:06:23PM -0700, Jakub Kicinski wrote:
> On Sun, 22 Mar 2020 21:51:09 +0100 Michal Kubecek wrote:
> > On Sun, Mar 22, 2020 at 01:43:56PM -0700, Jakub Kicinski wrote:
> > > On Sun, 22 Mar 2020 21:15:51 +0100 (CET) Michal Kubecek wrote:
> > > > 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.
> > >
> > > Fixes: e54d04e3afea ("ethtool: set message mask with DEBUG_SET request")
> > > Fixes: a53f3d41e4d3 ("ethtool: set link settings with LINKINFO_SET request")
> > > Fixes: bfbcfe2032e7 ("ethtool: set link modes related data with LINKMODES_SET request")
> > > Fixes: 8d425b19b305 ("ethtool: set wake-on-lan settings with WOL_SET request")
> >
> > Yes, thank you, I forgot about Fixes tags.
> >
> > Should I resubmit or will patchworks pick the tags from your reply?
>
> Patchwork sees them, I think, but I don't think it adds them to the
> patch as downloaded by git-pw. Probably easiest to repost.

Sent v2 with Fixes and Reviewed-by tags.

Michal

> > > > Reported-by: Andrew Lunn <andrew@xxxxxxx>
> > > > Signed-off-by: Michal Kubecek <mkubecek@xxxxxxx>
> > >
> > > Reviewed-by: Jakub Kicinski <kuba@xxxxxxxxxx>
>