netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	mailhol.vincent@wanadoo.fr, sudheer.mogilappagari@intel.com,
	sbhatta@marvell.com, linux-doc@vger.kernel.org,
	wangjie125@huawei.com, corbet@lwn.net, lkp@intel.com,
	gal@nvidia.com, gustavoars@kernel.org, bagasdotme@gmail.com
Subject: Re: [PATCH net-next 1/1] ethtool/plca: fix potential NULL pointer access
Date: Tue, 17 Jan 2023 10:13:30 +0100	[thread overview]
Message-ID: <Y8ZmupvQv/N8561y@gvm01> (raw)
In-Reply-To: <20230117003426.pzioywqybaxq4pzm@skbuf>

On Tue, Jan 17, 2023 at 02:34:26AM +0200, Vladimir Oltean wrote:
> On Tue, Jan 17, 2023 at 12:57:19AM +0100, Piergiorgio Beruto wrote:
> > Fix problem found by syzbot dereferencing a device pointer.
> > 
> > Signed-off-by: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
> > Reported-by: syzbot+8cf35743af243e5f417e@syzkaller.appspotmail.com
> > Fixes: 8580e16c28f3 ("net/ethtool: add netlink interface for the PLCA RS")
> > ---
> >  net/ethtool/plca.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/net/ethtool/plca.c b/net/ethtool/plca.c
> > index be7404dc9ef2..bc3d31f99998 100644
> > --- a/net/ethtool/plca.c
> > +++ b/net/ethtool/plca.c
> > @@ -155,6 +155,8 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info)
> >  		return ret;
> >  
> >  	dev = req_info.dev;
> > +	if(!dev)
> > +		return -ENODEV;
> 
> Shouldn't be necessary. The fact that you pass "true" to the
> "require_dev" argument of ethnl_parse_header_dev_get() takes care
> specifically of that.
> 
> Looking at that syzbot report, it looks like you solved it with commit
> 28dbf774bc87 ("plca.c: fix obvious mistake in checking retval"). Or was
> that not the only issue?
Oh, I believe you are correct.
I probably confused which version the bug was reported against.

Please, ignore this patch...
Thanks!

Piergiorgio

> 
> >  
> >  	rtnl_lock();
> >  
> > -- 
> > 2.37.4
> > 

      reply	other threads:[~2023-01-17  9:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16 23:57 [PATCH net-next 1/1] ethtool/plca: fix potential NULL pointer access Piergiorgio Beruto
2023-01-17  0:34 ` Vladimir Oltean
2023-01-17  9:13   ` Piergiorgio Beruto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y8ZmupvQv/N8561y@gvm01 \
    --to=piergiorgio.beruto@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=bagasdotme@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=gustavoars@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lkp@intel.com \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sudheer.mogilappagari@intel.com \
    --cc=wangjie125@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).