Acked-by: Ying Xue <ying....@windriver.com>

-----Original Message-----
From: Parthasarathy Bhuvaragan [mailto:parthasarathy.bhuvara...@ericsson.com] 
Sent: Monday, July 25, 2016 8:25 PM
To: tipc-discussion@lists.sourceforge.net; jon.ma...@ericsson.com; 
ma...@donjonn.com; Xue, Ying; erik.hu...@gmail.com
Subject: [RFC PATCH v1 01/12] tipc: set kern=0 in sk_alloc() during 
tipc_accept()

Until now, tipc_accept() calls sk_alloc() with kern=1. This is incorrect as the 
data socket's owner is the user application.
Thus for these accepted data sockets the network namespace refcount is skipped.

In this commit, we fix this by setting kern=0.

Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvara...@ericsson.com>
---
 net/tipc/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 
c49b8df438cb..6b53251905e4 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -2086,7 +2086,7 @@ static int tipc_accept(struct socket *sock, struct socket 
*new_sock, int flags)
 
        buf = skb_peek(&sk->sk_receive_queue);
 
-       res = tipc_sk_create(sock_net(sock->sk), new_sock, 0, 1);
+       res = tipc_sk_create(sock_net(sock->sk), new_sock, 0, 0);
        if (res)
                goto exit;
        security_sk_clone(sock->sk, new_sock->sk);
--
2.1.4

------------------------------------------------------------------------------
_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to