All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: syzbot <syzbot+263a248eec3e875baa7b@syzkaller.appspotmail.com>,
	davem@davemloft.net, kuba@kernel.org,
	linux-kernel@vger.kernel.org, mathew.j.martineau@linux.intel.com,
	matthieu.baerts@tessares.net, mptcp@lists.linux.dev,
	netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] WARNING in mptcp_sendmsg_frag
Date: Thu, 23 Sep 2021 17:13:53 +0200	[thread overview]
Message-ID: <286faa2529e01e6091666f97ad0cc703e5e80c7c.camel@redhat.com> (raw)
In-Reply-To: <20210923143728.GD2083@kadam>

Hello,

On Thu, 2021-09-23 at 17:37 +0300, Dan Carpenter wrote:
> On Thu, Sep 23, 2021 at 05:19:42PM +0300, Dan Carpenter wrote:
> > On Wed, Sep 22, 2021 at 12:32:56PM +0200, Paolo Abeni wrote:
> > > #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > > 
> > > The debug code helped a bit. It looks like we have singed/unsigned
> > > comparisons issue
> > 
> > There should be a static checker warning for these.  I have created one
> > in response to your email.  It turns out there are a couple other
> > instances of this bug in the same file.

Thank you!

I was quite suprised the plain compiler did not emit a warn, even with
W=1.

> > net/mptcp/protocol.c:479 mptcp_subflow_could_cleanup() warn: unsigned subtraction: '(null)' use '!='
> 
> I should have checked my output a bit more carefully.  I don't want this
> one to generate a warning.
> 
> > net/mptcp/protocol.c:909 mptcp_frag_can_collapse_to() warn: unsigned subtraction: 'pfrag->size - pfrag->offset' use '!='
> 
> Likely "pfrag->offset" can't be larger than "pfrag->size".  Smatch has
> some code to try track this information but it's not clever enough.

Yes, this looks safe, offset can't be larger than size.

Even the last reported warning looks safe to me: 'info->size_goal -
skb->len', we just check for size_goal being greater then skb->len.

Cheers,

Paolo


  reply	other threads:[~2021-09-23 15:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  4:05 [syzbot] WARNING in mptcp_sendmsg_frag syzbot
2021-09-15  4:05 ` syzbot
2021-09-15 17:57 ` Mat Martineau
2021-09-16 14:53 ` Paolo Abeni
2021-09-16 14:53   ` Paolo Abeni
2021-09-18 11:50 ` syzbot
2021-09-18 11:50   ` syzbot
2021-09-21 17:39   ` Paolo Abeni
2021-09-21 20:38     ` syzbot
2021-09-22 10:32   ` Paolo Abeni
2021-09-22 10:32     ` Paolo Abeni
2021-09-22 10:58     ` syzbot
2021-09-22 10:58       ` syzbot
2021-09-23 14:19     ` Dan Carpenter
2021-09-23 14:37       ` Dan Carpenter
2021-09-23 15:13         ` Paolo Abeni [this message]
2021-09-23 15:13           ` Paolo Abeni
2021-09-20 16:52 ` Paolo Abeni
2021-09-20 20:48   ` syzbot
2021-09-21 10:00 ` Paolo Abeni
2021-09-21 12:44   ` syzbot

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=286faa2529e01e6091666f97ad0cc703e5e80c7c.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathew.j.martineau@linux.intel.com \
    --cc=matthieu.baerts@tessares.net \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+263a248eec3e875baa7b@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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.