netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: sp3485@columbia.edu, netdev@vger.kernel.org,
	xiyou.wangcong@gmail.com, andrew.aday@columbia.edu
Subject: Re: [PATCH net] tcp/dccp: remove reqsk_put() from inet_child_forget()
Date: Tue, 12 Sep 2017 20:39:14 -0700 (PDT)	[thread overview]
Message-ID: <20170912.203914.1695474417183964442.davem@davemloft.net> (raw)
In-Reply-To: <1505170718.15310.134.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 11 Sep 2017 15:58:38 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> Back in linux-4.4, I inadvertently put a call to reqsk_put() in
> inet_child_forget(), forgetting it could be called from two different
> points.
> 
> In the case it is called from inet_csk_reqsk_queue_add(), we want to
> keep the reference on the request socket, since it is released later by
> the caller (tcp_v{4|6}_rcv())
> 
> This bug never showed up because atomic_dec_and_test() was not signaling
> the underflow, and SLAB_DESTROY_BY RCU semantic for request sockets
> prevented the request to be put in quarantine.
> 
> Recent conversion of socket refcount from atomic_t to refcount_t finally
> exposed the bug.
> 
> So move the reqsk_put() to inet_csk_listen_stop() to fix this.
> 
> Thanks to Shankara Pailoor for using syzkaller and providing
> a nice set of .config and C repro.
 ...
> Fixes: ebb516af60e1 ("tcp/dccp: fix race at listener dismantle phase")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Shankara Pailoor <sp3485@columbia.edu>
> Tested-by: Shankara Pailoor <sp3485@columbia.edu>

Applied and queued up for -stable.

Thanks.

      reply	other threads:[~2017-09-13  3:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAASgV=s63Mj5Ki-ep0pUrOpGonaaOZm3TEeENk+rjxA=koxPfg@mail.gmail.com>
2017-09-08 17:21 ` WARNING: CPU: 2 PID: 4277 at lib/refcount.c:186 Cong Wang
2017-09-08 18:46   ` Eric Dumazet
2017-09-11  3:34     ` Eric Dumazet
2017-09-11 21:43       ` Shankara Pailoor
2017-09-11 21:58         ` Eric Dumazet
2017-09-11 22:58         ` [PATCH net] tcp/dccp: remove reqsk_put() from inet_child_forget() Eric Dumazet
2017-09-13  3:39           ` David Miller [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=20170912.203914.1695474417183964442.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew.aday@columbia.edu \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sp3485@columbia.edu \
    --cc=xiyou.wangcong@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 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).