Re: [patch] __lock_sock race condition in 2.3.18*

Andrea Arcangeli (andrea@suse.de)
Tue, 21 Sep 1999 20:07:34 +0200 (CEST)


As Alexey pointed out to me I have a bug in my tcp_get_info deadlock fix.

I think this incremental patch will cure such problem that I missed. This
because by running synq_init after reading the top of the queue we are
making the whole list local to us and then we can do everything we want
with it without risk to race with tcp_get_info.

--- 2.3.18ac7-netlockup/net/ipv4/tcp.c.~1~ Tue Sep 21 19:54:59 1999
+++ 2.3.18ac7-netlockup/net/ipv4/tcp.c Tue Sep 21 19:59:04 1999
@@ -1471,6 +1471,9 @@
struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp);
struct open_request *req = tp->syn_wait_queue;

+ /* make all the syn_wait_queue list local to us */
+ tcp_synq_init_bh(tp);
+
while(req) {
struct open_request *iter;

@@ -1491,7 +1494,6 @@
}
BUG_TRAP(tp->syn_backlog == 0);
BUG_TRAP(sk->ack_backlog == 0);
- tcp_synq_init_bh(tp);
}

static __inline__ void tcp_kill_sk_queues(struct sock *sk)

A new whole fixed patch against 2.3.18ac7 can be found here:

ftp://ftp.suse.com/pub/people/andrea/kernel-patches/my-2.3.18ac7/netlockup-2

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/