linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <kuba@kernel.org>
Cc: <casey@schaufler-ca.com>, <davem@davemloft.net>,
	<dsahern@kernel.org>, <edumazet@google.com>, <horms@kernel.org>,
	<jmorris@namei.org>, <kadlec@netfilter.org>, <kuni1840@gmail.com>,
	<kuniyu@amazon.com>, <linux-security-module@vger.kernel.org>,
	<ncardwell@google.com>, <netdev@vger.kernel.org>,
	<pabeni@redhat.com>, <pablo@netfilter.org>, <paul@paul-moore.com>,
	<selinux@vger.kernel.org>, <serge@hallyn.com>,
	<willemb@google.com>
Subject: Re: [PATCH v2 net-next 0/4] net: Retire DCCP socket.
Date: Wed, 9 Apr 2025 11:53:41 -0700	[thread overview]
Message-ID: <20250409185356.37457-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20250409064949.6c992d15@kernel.org>

From: Jakub Kicinski <kuba@kernel.org>
Date: Wed, 9 Apr 2025 06:49:49 -0700
> On Tue, 8 Apr 2025 17:29:07 -0700 Kuniyuki Iwashima wrote:
> > As announced by commit b144fcaf46d4 ("dccp: Print deprecation
> > notice."), it's time to remove DCCP socket.
> > 
> > The patch 2 removes net/dccp, LSM code, doc, and etc, leaving
> > DCCP netfilter modules.
> > 
> > The patch 3 unexports shared functions for DCCP, and the patch 4
> > renames tcp_or_dccp_get_hashinfo() to tcp_get_hashinfo().
> > 
> > We can do more cleanup; for example, remove IPPROTO_TCP checks in
> > __inet6?_check_established(), remove __module_get() for twsk,
> > remove timewait_sock_ops.twsk_destructor(), etc, but it will be
> > more of TCP stuff, so I'll defer to a later series.
> 
> So it builds now but appears to break 1/3rd of the selftests :)

Ahh sorry, I made a mistake while inlining sk_clone_lock()...

Will squash diff below in v3.

Thanks!


---8<---
$ git diff --cached | cat
diff --git a/net/core/sock.c b/net/core/sock.c
index e76b2bcec33d..e053ab6380f5 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2490,13 +2490,13 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
 		if (!is_charged)
 			RCU_INIT_POINTER(newsk->sk_filter, NULL);
 
-		goto out;
+		goto free;
 	}
 
 	RCU_INIT_POINTER(newsk->sk_reuseport_cb, NULL);
 
 	if (bpf_sk_storage_clone(sk, newsk))
-		goto out;
+		goto free;
 
 	/* Clear sk_user_data if parent had the pointer tagged
 	 * as not suitable for copying when cloning.
@@ -2525,12 +2525,16 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
 	if (sock_needs_netstamp(sk) && newsk->sk_flags & SK_FLAGS_TIMESTAMP)
 		net_enable_timestamp();
 out:
+	return newsk;
+free:
 	/* It is still raw copy of parent, so invalidate
-	 * destructor and make plain sk_free() */
+	 * destructor and make plain sk_free()
+	 */
 	newsk->sk_destruct = NULL;
 	bh_unlock_sock(newsk);
 	sk_free(newsk);
-	return NULL;
+	newsk = NULL;
+	goto out;
 }
 EXPORT_SYMBOL_GPL(sk_clone_lock);
 
---8<---

      reply	other threads:[~2025-04-09 18:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09  0:29 [PATCH v2 net-next 0/4] net: Retire DCCP socket Kuniyuki Iwashima
2025-04-09  0:29 ` [PATCH v2 net-next 1/4] selftest: net: Remove DCCP bits Kuniyuki Iwashima
2025-04-09  0:29 ` [PATCH v2 net-next 2/4] net: Retire DCCP socket Kuniyuki Iwashima
2025-04-09  0:29 ` [PATCH v2 net-next 3/4] net: Unexport shared functions for DCCP Kuniyuki Iwashima
2025-04-09  0:29 ` [PATCH v2 net-next 4/4] tcp: Rename tcp_or_dccp_get_hashinfo() Kuniyuki Iwashima
2025-04-09 13:49 ` [PATCH v2 net-next 0/4] net: Retire DCCP socket Jakub Kicinski
2025-04-09 18:53   ` Kuniyuki Iwashima [this message]

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=20250409185356.37457-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=casey@schaufler-ca.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jmorris@namei.org \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=paul@paul-moore.com \
    --cc=selinux@vger.kernel.org \
    --cc=serge@hallyn.com \
    --cc=willemb@google.com \
    /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).