Merge branch 'rds-tcp-sock_graft-leak'
Sowmini Varadhan says: ==================== rds-tcp: sock_graft() leak Following up on the discussion at https://www.spinics.net/lists/netdev/msg442859.html - make rds_tcp_accept_one() call sock_create_lite() - add a WARN_ON() to sock_graft() Tested by running an infinite while() loop that does (module-load; rds-stress; module-unload) and monitors TCP slabinfo while the test is running. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
5dc314f8de
|
@ -1697,6 +1697,7 @@ static inline void sock_orphan(struct sock *sk)
|
|||
|
||||
static inline void sock_graft(struct sock *sk, struct socket *parent)
|
||||
{
|
||||
WARN_ON(parent->sk);
|
||||
write_lock_bh(&sk->sk_callback_lock);
|
||||
sk->sk_wq = parent->wq;
|
||||
parent->sk = sk;
|
||||
|
|
|
@ -136,7 +136,7 @@ int rds_tcp_accept_one(struct socket *sock)
|
|||
if (!sock) /* module unload or netns delete in progress */
|
||||
return -ENETUNREACH;
|
||||
|
||||
ret = sock_create_kern(sock_net(sock->sk), sock->sk->sk_family,
|
||||
ret = sock_create_lite(sock->sk->sk_family,
|
||||
sock->sk->sk_type, sock->sk->sk_protocol,
|
||||
&new_sock);
|
||||
if (ret)
|
||||
|
|
Loading…
Reference in New Issue