Commit a77be819 authored by Kyle Moffett's avatar Kyle Moffett Committed by David S. Miller

[NET]: Fix setsockopt locking bug

On Sparc, SO_DONTLINGER support resulted in sock_reset_flag being 
called without lock_sock().
Signed-off-by: default avatarKyle Moffett <mrmacman_g4@mac.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cbcd2a4c
...@@ -206,13 +206,14 @@ int sock_setsockopt(struct socket *sock, int level, int optname, ...@@ -206,13 +206,14 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
*/ */
#ifdef SO_DONTLINGER /* Compatibility item... */ #ifdef SO_DONTLINGER /* Compatibility item... */
switch (optname) { if (optname == SO_DONTLINGER) {
case SO_DONTLINGER: lock_sock(sk);
sock_reset_flag(sk, SOCK_LINGER); sock_reset_flag(sk, SOCK_LINGER);
return 0; release_sock(sk);
return 0;
} }
#endif #endif
if(optlen<sizeof(int)) if(optlen<sizeof(int))
return(-EINVAL); return(-EINVAL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment