netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
To: <netdev@vger.kernel.org>
Cc: jon.maloy@ericsson.com, tipc-discussion@lists.sourceforge.net
Subject: [PATCH net-next v1 03/16] tipc: set kern=0 in sk_alloc() during tipc_accept()
Date: Thu, 27 Oct 2016 16:22:24 +0200	[thread overview]
Message-ID: <1477578157-13256-4-git-send-email-parthasarathy.bhuvaragan@ericsson.com> (raw)
In-Reply-To: <1477578157-13256-1-git-send-email-parthasarathy.bhuvaragan@ericsson.com>

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 <ying.xue@windriver.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@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 cd01deb1da9c..82aec2eb8497 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);
-- 
2.1.4


------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik

  parent reply	other threads:[~2016-10-27 14:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 14:22 [PATCH net-next v1 00/16] tipc: socket layer improvements Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 01/16] tipc: return early for non-blocking sockets at link congestion Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 02/16] tipc: wakeup sleeping users at disconnect Parthasarathy Bhuvaragan
2016-10-27 14:22 ` Parthasarathy Bhuvaragan [this message]
2016-10-27 14:22 ` [PATCH net-next v1 04/16] tipc: rename struct tipc_skb_cb member handle to bytes_read Parthasarathy Bhuvaragan
2016-10-29 21:01   ` David Miller
2016-10-27 14:22 ` [PATCH net-next v1 05/16] tipc: rename tsk->remote to tsk->peer for consistent naming Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 06/16] tipc: remove tsk->connected for connectionless sockets Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 07/16] tipc: remove tsk->connected from tipc_sock Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 08/16] tipc: remove probing_intv " Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 09/16] tipc: remove socket state SS_READY Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 10/16] tipc: create TIPC_LISTEN as a new sk_state Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 11/16] tipc: create TIPC_PROBING/TIPC_ESTABLISHED as new sk_states Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 12/16] tipc: create TIPC_OPEN as a new sk_state Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 13/16] tipc: create TIPC_DISCONNECTING " Parthasarathy Bhuvaragan
2016-10-27 15:03   ` Eric Dumazet
2016-10-28 11:14     ` Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 14/16] tipc: create TIPC_CLOSING " Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 15/16] tipc: create TIPC_CONNECTING " Parthasarathy Bhuvaragan
2016-10-27 14:22 ` [PATCH net-next v1 16/16] tipc: remove SS_CONNECTED sock state Parthasarathy Bhuvaragan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1477578157-13256-4-git-send-email-parthasarathy.bhuvaragan@ericsson.com \
    --to=parthasarathy.bhuvaragan@ericsson.com \
    --cc=jon.maloy@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).