lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 29 Oct 2007 13:52:22 -0700
From:	Stephen Hemminger <>
To:	"David S. Miller" <>
Cc:	Arnaldo Carvalho de Melo <>,
Subject: [PATCH] inet: race in wait for connect.

Fix possible race while waiting for connections in accept. I don't
know of a test case that could reproduce this directly.

The state of the socket should be checked before checking the queue.
If the socket has left the TCP_LISTEN state, then the accept queue
is no longer valid.

Signed-off-by: Stephen Hemminger <>

--- a/net/ipv4/inet_connection_sock.c	2007-10-26 11:54:41.000000000 -0700
+++ b/net/ipv4/inet_connection_sock.c	2007-10-29 08:34:03.000000000 -0700
@@ -203,12 +203,12 @@ static int inet_csk_wait_for_connect(str
 		if (reqsk_queue_empty(&icsk->icsk_accept_queue))
 			timeo = schedule_timeout(timeo);
-		err = 0;
-		if (!reqsk_queue_empty(&icsk->icsk_accept_queue))
-			break;
 		err = -EINVAL;
 		if (sk->sk_state != TCP_LISTEN)
+		err = 0;
+		if (!reqsk_queue_empty(&icsk->icsk_accept_queue))
+			break;
 		err = sock_intr_errno(timeo);
 		if (signal_pending(current))
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists