Skip to content

Commit

Permalink
Revert "net: kernel socket should be released in init_net namespace"
Browse files Browse the repository at this point in the history
This reverts commit c243d7e.

That patch is solving a non-existant problem while creating a
real problem.  Just because a socket is allocated in the init
name space doesn't mean that it gets hashed in the init name space.

When we unhash it the name space must be the same as the one
we had when we hashed it.  So this patch is completely bogus
and causes socket leaks.

Reported-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed May 4, 2015
1 parent bd4d95a commit 2e70aed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1474,8 +1474,8 @@ void sk_release_kernel(struct sock *sk)
return;

sock_hold(sk);
sock_net_set(sk, get_net(&init_net));
sock_release(sk->sk_socket);
sock_net_set(sk, get_net(&init_net));
sock_put(sk);
}
EXPORT_SYMBOL(sk_release_kernel);
Expand Down

0 comments on commit 2e70aed

Please sign in to comment.