All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: syzbot <syzbot+581aff2ae6b860625116@syzkaller.appspotmail.com>,
	davem <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-sctp @ vger . kernel . org" <linux-sctp@vger.kernel.org>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	network dev <netdev@vger.kernel.org>,
	Neil Horman <nhorman@tuxdriver.com>,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
	Vlad Yasevich <vyasevich@gmail.com>
Subject: Re: [syzbot] general protection fault in sctp_rcv
Date: Thu, 23 Sep 2021 12:34:42 +0300	[thread overview]
Message-ID: <20210923093442.GC2048@kadam> (raw)
In-Reply-To: <CADvbK_c-V6orWGm2ae1pxoUU-5J-1J-a057hYemA6oTESGhFMg@mail.gmail.com>

On Wed, Sep 22, 2021 at 05:18:29PM +0800, Xin Long wrote:
> On Tue, Sep 21, 2021 at 12:09 PM syzbot
> <syzbot+581aff2ae6b860625116@syzkaller.appspotmail.com> wrote:
> >
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > HEAD commit:    98dc68f8b0c2 selftests: nci: replace unsigned int with int
> > git tree:       net
> > console output: https://syzkaller.appspot.com/x/log.txt?x=11fd443d300000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=c31c0936547df9ea
> > dashboard link: https://syzkaller.appspot.com/bug?extid=581aff2ae6b860625116
> > compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> >
> > Unfortunately, I don't have any reproducer for this issue yet.
> >
> > IMPORTANT: if you fix the issue, please add the following tag to the commit:
> > Reported-by: syzbot+581aff2ae6b860625116@syzkaller.appspotmail.com
> >
> > general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
> > KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
> > CPU: 0 PID: 11205 Comm: kworker/0:12 Not tainted 5.14.0-syzkaller #0
> > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> > Workqueue: ipv6_addrconf addrconf_dad_work
> > RIP: 0010:sctp_rcv_ootb net/sctp/input.c:705 [inline]
> by anyway, checking if skb_header_pointer() return NULL is always needed:
> @@ -702,7 +702,7 @@ static int sctp_rcv_ootb(struct sk_buff *skb)
>                 ch = skb_header_pointer(skb, offset, sizeof(*ch), &_ch);
> 
>                 /* Break out if chunk length is less then minimal. */
> -               if (ntohs(ch->length) < sizeof(_ch))
> +               if (!ch || ntohs(ch->length) < sizeof(_ch))
>                         break;
> 

The skb_header_pointer() function is annotated as __must_check but that
only means you have to use the return value.  These things would be
better as a Coccinelle or Smatch check.

I will create a Smatch warning for this.

regards,
dan carpenter


  reply	other threads:[~2021-09-23  9:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-21  2:56 [syzbot] general protection fault in sctp_rcv syzbot
2021-09-22  9:18 ` Xin Long
2021-09-23  9:34   ` Dan Carpenter [this message]
2021-09-24 17:14     ` Dan Carpenter
2021-10-03  9:43       ` Xin Long

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=20210923093442.GC2048@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=syzbot+581aff2ae6b860625116@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=vyasevich@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.