netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: 慕冬亮 <dzm91@hust.edu.cn>
To: "denis kirjanov" <dkirjanov@suse.de>
Cc: "alexander aring" <alex.aring@gmail.com>,
	"stefan schmidt" <stefan@datenfreihafen.org>,
	"miquel raynal" <miquel.raynal@bootlin.com>,
	"david s. miller" <davem@davemloft.net>,
	"eric dumazet" <edumazet@google.com>,
	"jakub kicinski" <kuba@kernel.org>,
	"paolo abeni" <pabeni@redhat.com>,
	syzbot+bd85b31816913a32e473@syzkaller.appspotmail.com,
	linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH] net: ieee802154: fix a null pointer in nl802154_trigger_scan
Date: Tue, 7 Mar 2023 17:09:29 +0800 (GMT+08:00)	[thread overview]
Message-ID: <697a2a6.23479.186bb5537c5.Coremail.dzm91@hust.edu.cn> (raw)
In-Reply-To: <782a6f2d-84ae-3530-7e3c-07f31a4f303b@suse.de>




> -----原始邮件-----
> 发件人: "Denis Kirjanov" <dkirjanov@suse.de>
> 发送时间: 2023-03-07 16:43:46 (星期二)
> 收件人: "Dongliang Mu" <dzm91@hust.edu.cn>, "Alexander Aring" <alex.aring@gmail.com>, "Stefan Schmidt" <stefan@datenfreihafen.org>, "Miquel Raynal" <miquel.raynal@bootlin.com>, "David S. Miller" <davem@davemloft.net>, "Eric Dumazet" <edumazet@google.com>, "Jakub Kicinski" <kuba@kernel.org>, "Paolo Abeni" <pabeni@redhat.com>
> 抄送: syzbot+bd85b31816913a32e473@syzkaller.appspotmail.com, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
> 主题: Re: [PATCH] net: ieee802154: fix a null pointer in nl802154_trigger_scan
> 
> 
> 
> On 3/7/23 10:30, Dongliang Mu wrote:
> > There is a null pointer dereference if NL802154_ATTR_SCAN_TYPE is
> > not set by the user.
> > 
> > Fix this by adding a null pointer check.
> > 
> > Reported-and-tested-by: syzbot+bd85b31816913a32e473@syzkaller.appspotmail.com
> > Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
> 
> Please add a Fixes: tag 

I've sent a v2 patch. Thanks for your reminder.

> 
> > ---
> >  net/ieee802154/nl802154.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
> > index 2215f576ee37..1cf00cffd63f 100644
> > --- a/net/ieee802154/nl802154.c
> > +++ b/net/ieee802154/nl802154.c
> > @@ -1412,7 +1412,8 @@ static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info)
> >  		return -EOPNOTSUPP;
> >  	}
> >  
> > -	if (!nla_get_u8(info->attrs[NL802154_ATTR_SCAN_TYPE])) {
> > +	if (!info->attrs[NL802154_ATTR_SCAN_TYPE] ||
> > +	    !nla_get_u8(info->attrs[NL802154_ATTR_SCAN_TYPE])) {
> >  		NL_SET_ERR_MSG(info->extack, "Malformed request, missing scan type");
> >  		return -EINVAL;
> >  	}


      parent reply	other threads:[~2023-03-07  9:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07  7:30 [PATCH] net: ieee802154: fix a null pointer in nl802154_trigger_scan Dongliang Mu
2023-03-07  8:43 ` Denis Kirjanov
2023-03-07  9:09   ` Miquel Raynal
2023-03-07  9:21     ` 慕冬亮
2023-03-07  9:34       ` Miquel Raynal
2023-03-07  9:09   ` 慕冬亮 [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=697a2a6.23479.186bb5537c5.Coremail.dzm91@hust.edu.cn \
    --to=dzm91@hust.edu.cn \
    --cc=alex.aring@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dkirjanov@suse.de \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stefan@datenfreihafen.org \
    --cc=syzbot+bd85b31816913a32e473@syzkaller.appspotmail.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).