changeset 1991:1010864f2812

* src/sys/kern/uipc_socket.c (sodealloc): Fixed a race condition when freeing the socket memory. Problem reported by Will Lent.
author asl
date Fri, 17 Jun 2005 20:09:51 +0000
parents de59216e37db
children ec8b69673c6e
files packages/net/bsd_tcpip/current/ChangeLog packages/net/bsd_tcpip/current/src/sys/kern/uipc_socket.c
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/bsd_tcpip/current/ChangeLog
+++ b/packages/net/bsd_tcpip/current/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-17  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* src/sys/kern/uipc_socket.c (sodealloc): Fixed a race condition
+	when freeing the socket memory. Problem reported by Will Lent.
+
 2005-03-27  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/sys/net/if.c (ifioctl): Fixed a compiler warning about 
--- a/packages/net/bsd_tcpip/current/src/sys/kern/uipc_socket.c
+++ b/packages/net/bsd_tcpip/current/src/sys/kern/uipc_socket.c
@@ -188,8 +188,10 @@ sobind(so, nam, p)
 void
 sodealloc(so)
 	struct socket *so;
+        
 {
-
+        vm_zone_t zone;
+  
 	so->so_gencnt = ++so_gencnt;
 #ifdef INET
 	if (so->so_accf != NULL) {
@@ -202,8 +204,9 @@ sodealloc(so)
 		FREE(so->so_accf, M_ACCF);
 	}
 #endif /* INET */
-	zfreei(so->so_zone, so);
-        wakeup(so->so_zone);
+        zone = so->so_zone;
+        zfreei(zone, so);
+        wakeup(zone);
 }
 
 int