All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qiujun Huang <hqjagain@gmail.com>
To: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: vyasevich@gmail.com, nhorman@tuxdriver.com,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-sctp@vger.kernel.org, netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sctp: fix refcount bug in sctp_wfree
Date: Tue, 17 Mar 2020 12:44:10 +0800	[thread overview]
Message-ID: <CAJRQjodkqMM8Sap50UaDr5fXD+30+5tgpj4-CdEt9fM2WVjm7w@mail.gmail.com> (raw)
In-Reply-To: <20200317041523.GB3756@localhost.localdomain>

On Tue, Mar 17, 2020 at 12:15 PM Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
>
> On Mon, Mar 16, 2020 at 11:53:24AM +0800, Qiujun Huang wrote:
> > Do accounting for skb's real sk.
> > In some case skb->sk != asoc->base.sk.
>
> This is a too simple description.  Please elaborate how this can
> happen in sctp_wfree. Especially considering the construct for
> migrating the tx queue on sctp_sock_migrate(), as both sockets are
> locked while moving the chunks around and the asoc itself is only
> moved in between decrementing and incrementing the refcount:
>
>         lock_sock_nested(newsk, SINGLE_DEPTH_NESTING);
>         sctp_for_each_tx_datachunk(assoc, sctp_clear_owner_w);
>         sctp_assoc_migrate(assoc, newsk);
>         sctp_for_each_tx_datachunk(assoc, sctp_set_owner_w);
>         ...

Yeah, the description is too simple. I'll send v2.

>
> >
> > Reported-and-tested-by: syzbot+cea71eec5d6de256d54d@syzkaller.appspotmail.com
>
> I can't see a positive test result, though. If I didn't loose any
> email, your last test with a patch similar to this one actually
> failed.
> I'm talking about syzbot test result at Message-ID: <000000000000e7736205a0e041f5@google.com>

I told with syzbot privately avoiding noise :p
Thanks!

WARNING: multiple messages have this Message-ID (diff)
From: Qiujun Huang <hqjagain@gmail.com>
To: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: vyasevich@gmail.com, nhorman@tuxdriver.com,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-sctp@vger.kernel.org, netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sctp: fix refcount bug in sctp_wfree
Date: Tue, 17 Mar 2020 04:44:10 +0000	[thread overview]
Message-ID: <CAJRQjodkqMM8Sap50UaDr5fXD+30+5tgpj4-CdEt9fM2WVjm7w@mail.gmail.com> (raw)
In-Reply-To: <20200317041523.GB3756@localhost.localdomain>

On Tue, Mar 17, 2020 at 12:15 PM Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
>
> On Mon, Mar 16, 2020 at 11:53:24AM +0800, Qiujun Huang wrote:
> > Do accounting for skb's real sk.
> > In some case skb->sk != asoc->base.sk.
>
> This is a too simple description.  Please elaborate how this can
> happen in sctp_wfree. Especially considering the construct for
> migrating the tx queue on sctp_sock_migrate(), as both sockets are
> locked while moving the chunks around and the asoc itself is only
> moved in between decrementing and incrementing the refcount:
>
>         lock_sock_nested(newsk, SINGLE_DEPTH_NESTING);
>         sctp_for_each_tx_datachunk(assoc, sctp_clear_owner_w);
>         sctp_assoc_migrate(assoc, newsk);
>         sctp_for_each_tx_datachunk(assoc, sctp_set_owner_w);
>         ...

Yeah, the description is too simple. I'll send v2.

>
> >
> > Reported-and-tested-by: syzbot+cea71eec5d6de256d54d@syzkaller.appspotmail.com
>
> I can't see a positive test result, though. If I didn't loose any
> email, your last test with a patch similar to this one actually
> failed.
> I'm talking about syzbot test result at Message-ID: <000000000000e7736205a0e041f5@google.com>

I told with syzbot privately avoiding noise :p
Thanks!

  reply	other threads:[~2020-03-17  4:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16  3:53 [PATCH] sctp: fix refcount bug in sctp_wfree Qiujun Huang
2020-03-16  3:53 ` Qiujun Huang
2020-03-17  1:25 ` David Miller
2020-03-17  1:25   ` David Miller
2020-03-17  4:15 ` Marcelo Ricardo Leitner
2020-03-17  4:15   ` Marcelo Ricardo Leitner
2020-03-17  4:44   ` Qiujun Huang [this message]
2020-03-17  4:44     ` Qiujun Huang

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=CAJRQjodkqMM8Sap50UaDr5fXD+30+5tgpj4-CdEt9fM2WVjm7w@mail.gmail.com \
    --to=hqjagain@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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.