lkml.org 
[lkml]   [1997]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subjectsocket.c bug fix
Date
> It looks like this was introduced in Alan's "linux/net/socket.c"
> patches.
>
> Alan, I've only had time to glance at the changes, and so far I've
> discovered this: (1) there's a missing "unlock_kernel" at the end of
> "sys_shutdown"; (2) "sys_socketpair" doesn't seem to ever "sockfd_put"
> the descriptors it "sockfd_lookup"s.

Yep thats causing it. Unfortunately I've just committed the stuff for
2.1.26. I doubt this will get fixed in time for .26.

Alan

Try
--- net/socket.c~ Sun Feb 2 17:46:20 1997
+++ net/socket.c Thu Feb 6 22:22:44 1997
@@ -645,7 +645,7 @@
asmlinkage int sys_socketpair(int family, int type, int protocol, int usockvec[2])
{
int fd1, fd2, i;
- struct socket *sock1, *sock2;
+ struct socket *sock1=NULL, *sock2=NULL;
int err;

lock_kernel();
@@ -700,6 +700,10 @@
}
}
out:
+ if(sock1)
+ sockfd_put(sock1);
+ if(sock2)
+ sockfd_put(sock2);
unlock_kernel();
return err;
}
@@ -1114,6 +1118,7 @@
err=sock->ops->shutdown(sock, how);
sockfd_put(sock);
}
+ unlock_kernel();
return err;
}

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.030 / U:1.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site