From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, ycheng@google.com
Subject: Re: [PATCH net] inet: fix possible panic in reqsk_queue_unlink()
Date: Fri, 24 Apr 2015 11:39:30 -0400 (EDT) [thread overview]
Message-ID: <20150424.113930.411412345479090439.davem@davemloft.net> (raw)
In-Reply-To: <1429837424.22254.110.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 23 Apr 2015 18:03:44 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> [ 3897.923145] BUG: unable to handle kernel NULL pointer dereference at
> 0000000000000080
> [ 3897.931025] IP: [<ffffffffa9f27686>] reqsk_timer_handler+0x1a6/0x243
>
> There is a race when reqsk_timer_handler() and tcp_check_req() call
> inet_csk_reqsk_queue_unlink() on the same req at the same time.
>
> Before commit fa76ce7328b2 ("inet: get rid of central tcp/dccp listener
> timer"), listener spinlock was held and race could not happen.
>
> To solve this bug, we change reqsk_queue_unlink() to not assume req
> must be found, and we return a status, to conditionally release a
> refcount on the request sock.
>
> This also means tcp_check_req() in non fastopen case might or not
> consume req refcount, so tcp_v6_hnd_req() & tcp_v4_hnd_req() have
> to properly handle this.
>
> (Same remark for dccp_check_req() and its callers)
>
> inet_csk_reqsk_queue_drop() is now too big to be inlined, as it is
> called 4 times in tcp and 3 times in dccp.
>
> Fixes: fa76ce7328b2 ("inet: get rid of central tcp/dccp listener timer")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Yuchung Cheng <ycheng@google.com>
Applied, thanks Eric.
prev parent reply other threads:[~2015-04-24 15:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-24 1:03 [PATCH net] inet: fix possible panic in reqsk_queue_unlink() Eric Dumazet
2015-04-24 15: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=20150424.113930.411412345479090439.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=ycheng@google.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).