OSDN Git Service

tcp/dccp: fix race at listener dismantle phase
authorEric Dumazet <edumazet@google.com>
Wed, 14 Oct 2015 18:16:28 +0000 (11:16 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Oct 2015 07:52:19 +0000 (00:52 -0700)
commitebb516af60e18258aac8e80bbe068740ef1579ed
treebf2c3efa6f72141e1824bcd075fcfcc250475476
parentf03f2e154f52fdaa982de7e2c386737679963dc9
tcp/dccp: fix race at listener dismantle phase

Under stress, a close() on a listener can trigger the
WARN_ON(sk->sk_ack_backlog) in inet_csk_listen_stop()

We need to test if listener is still active before queueing
a child in inet_csk_reqsk_queue_add()

Create a common inet_child_forget() helper, and use it
from inet_csk_reqsk_queue_add() and inet_csk_listen_stop()

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_connection_sock.h
include/net/request_sock.h
net/ipv4/inet_connection_sock.c