aboutsummaryrefslogtreecommitdiff
path: root/include/net/inet_connection_sock.h
diff options
context:
space:
mode:
authorGravatar Eric Dumazet <edumazet@google.com> 2015-10-14 11:16:28 -0700
committerGravatar David S. Miller <davem@davemloft.net> 2015-10-16 00:52:19 -0700
commitebb516af60e18258aac8e80bbe068740ef1579ed (patch)
treebf2c3efa6f72141e1824bcd075fcfcc250475476 /include/net/inet_connection_sock.h
parenttcp/dccp: add inet_csk_reqsk_queue_drop_and_put() helper (diff)
downloadlinux-ebb516af60e18258aac8e80bbe068740ef1579ed.tar.gz
linux-ebb516af60e18258aac8e80bbe068740ef1579ed.tar.bz2
linux-ebb516af60e18258aac8e80bbe068740ef1579ed.zip
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>
Diffstat (limited to 'include/net/inet_connection_sock.h')
-rw-r--r--include/net/inet_connection_sock.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index e84ea9f2498f..63615709839d 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -268,13 +268,8 @@ struct dst_entry *inet_csk_route_child_sock(const struct sock *sk,
struct sock *newsk,
const struct request_sock *req);
-static inline void inet_csk_reqsk_queue_add(struct sock *sk,
- struct request_sock *req,
- struct sock *child)
-{
- reqsk_queue_add(&inet_csk(sk)->icsk_accept_queue, req, sk, child);
-}
-
+void inet_csk_reqsk_queue_add(struct sock *sk, struct request_sock *req,
+ struct sock *child);
void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req,
unsigned long timeout);