Re: [PATCH] removed socket buffer in unix domain socket

From: Go Taniguchi (go@turbolinux.co.jp)
Date: Fri Jan 11 2002 - 08:23:56 EST


What size of actually used hash table --unix_socket_table--?
If it is 256, probably forall_unix_sockets is dangerous.

forall_unix_sockets use 257 table size.
And If I apply this fix, test program can work.

Alan Cox wrote:

>> */
>>- if(UNIXCB(skb).fp)
>>+ if(s->dead && UNIXCB(skb).fp)
>> {
>>
>
> The bug may be real but the fix would prevent garbage collection working
> at all - which I grant would fix the problem.
>
> You don't need a socket to be dead to want to garbage collect it. If a
> socket is getting disposed of while in use then there is a
> maybe_unmark_and.. call missing, or a lock on the unix socket table missing
> somewhere.

-- GO!


--- linux/include/net/af_unix.h.orig Tue Apr 25 05:43:04 2000
+++ linux/include/net/af_unix.h Fri Jan 11 21:49:57 2002
@@ -14,7 +14,7 @@
 extern atomic_t unix_tot_inflight;
 
 
-#define forall_unix_sockets(i, s) for (i=0; i<=UNIX_HASH_SIZE; i++) \
+#define forall_unix_sockets(i, s) for (i=0; i<UNIX_HASH_SIZE; i++) \
                                     for (s=unix_socket_table[i]; s; s=s->next)
 
 struct unix_address

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



This archive was generated by hypermail 2b29 : Tue Jan 15 2002 - 21:00:35 EST