From: Parthasarathy Bhuvaragan Date: Tue, 1 Nov 2016 13:02:36 +0000 (+0100) Subject: tipc: set kern=0 in sk_alloc() during tipc_accept() X-Git-Tag: v4.14-rc1~1973^2~358^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb5da847af4418f91d0e83fc91c2fcb1def5537d;p=platform%2Fkernel%2Flinux-rpi3.git 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. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Parthasarathy Bhuvaragan Signed-off-by: David S. Miller --- diff --git a/net/tipc/socket.c b/net/tipc/socket.c index cd01deb..82aec2e 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -2093,7 +2093,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);