mbox series

[v2,net-next,0/4] net: Retire DCCP socket.

Message ID 20250409003014.19697-1-kuniyu@amazon.com (mailing list archive)
Headers show
Series net: Retire DCCP socket. | expand

Message

Kuniyuki Iwashima April 9, 2025, 12:29 a.m. UTC
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.


Changes:
  v2:
    * Patch 2
      * Drop netfilter changes
    * Patch 3
      * Leave inet_twsk_put() as is

  v1: https://lore.kernel.org/netdev/20250407231823.95927-1-kuniyu@amazon.com/


Kuniyuki Iwashima (4):
  selftest: net: Remove DCCP bits.
  net: Retire DCCP socket.
  net: Unexport shared functions for DCCP.
  tcp: Rename tcp_or_dccp_get_hashinfo().

 Documentation/admin-guide/bug-hunting.rst     |    2 +-
 Documentation/networking/dccp.rst             |  219 ---
 Documentation/networking/index.rst            |    1 -
 Documentation/networking/ip-sysctl.rst        |    4 +-
 .../zh_CN/admin-guide/bug-hunting.rst         |    2 +-
 .../zh_TW/admin-guide/bug-hunting.rst         |    2 +-
 MAINTAINERS                                   |    9 -
 arch/m68k/configs/amiga_defconfig             |    2 -
 arch/m68k/configs/apollo_defconfig            |    2 -
 arch/m68k/configs/atari_defconfig             |    2 -
 arch/m68k/configs/bvme6000_defconfig          |    2 -
 arch/m68k/configs/hp300_defconfig             |    2 -
 arch/m68k/configs/mac_defconfig               |    2 -
 arch/m68k/configs/multi_defconfig             |    2 -
 arch/m68k/configs/mvme147_defconfig           |    2 -
 arch/m68k/configs/mvme16x_defconfig           |    2 -
 arch/m68k/configs/q40_defconfig               |    2 -
 arch/m68k/configs/sun3_defconfig              |    2 -
 arch/m68k/configs/sun3x_defconfig             |    2 -
 arch/mips/configs/bigsur_defconfig            |    1 -
 arch/mips/configs/gpr_defconfig               |    1 -
 arch/mips/configs/mtx1_defconfig              |    1 -
 arch/powerpc/configs/pmac32_defconfig         |    1 -
 arch/powerpc/configs/ppc6xx_defconfig         |    1 -
 include/linux/dccp.h                          |  289 ---
 include/linux/tfrc.h                          |   51 -
 include/net/inet_hashtables.h                 |    7 +-
 include/net/rstreason.h                       |    2 +-
 include/net/secure_seq.h                      |    4 -
 include/net/sock.h                            |    1 -
 include/trace/events/sock.h                   |    1 -
 include/trace/events/sunrpc.h                 |    2 -
 net/Kconfig                                   |    1 -
 net/Makefile                                  |    1 -
 net/core/secure_seq.c                         |   42 -
 net/core/sock.c                               |   24 +-
 net/core/sock_diag.c                          |    2 -
 net/dccp/Kconfig                              |   46 -
 net/dccp/Makefile                             |   30 -
 net/dccp/ackvec.c                             |  403 -----
 net/dccp/ackvec.h                             |  136 --
 net/dccp/ccid.c                               |  219 ---
 net/dccp/ccid.h                               |  262 ---
 net/dccp/ccids/Kconfig                        |   55 -
 net/dccp/ccids/ccid2.c                        |  794 ---------
 net/dccp/ccids/ccid2.h                        |  121 --
 net/dccp/ccids/ccid3.c                        |  866 ---------
 net/dccp/ccids/ccid3.h                        |  148 --
 net/dccp/ccids/lib/loss_interval.c            |  184 --
 net/dccp/ccids/lib/loss_interval.h            |   69 -
 net/dccp/ccids/lib/packet_history.c           |  439 -----
 net/dccp/ccids/lib/packet_history.h           |  142 --
 net/dccp/ccids/lib/tfrc.c                     |   46 -
 net/dccp/ccids/lib/tfrc.h                     |   73 -
 net/dccp/ccids/lib/tfrc_equation.c            |  702 --------
 net/dccp/dccp.h                               |  483 -----
 net/dccp/diag.c                               |   85 -
 net/dccp/feat.c                               | 1581 -----------------
 net/dccp/feat.h                               |  133 --
 net/dccp/input.c                              |  739 --------
 net/dccp/ipv4.c                               | 1101 ------------
 net/dccp/ipv6.c                               | 1174 ------------
 net/dccp/ipv6.h                               |   27 -
 net/dccp/minisocks.c                          |  266 ---
 net/dccp/options.c                            |  609 -------
 net/dccp/output.c                             |  708 --------
 net/dccp/proto.c                              | 1293 --------------
 net/dccp/qpolicy.c                            |  136 --
 net/dccp/sysctl.c                             |  107 --
 net/dccp/timer.c                              |  272 ---
 net/dccp/trace.h                              |   82 -
 net/ipv4/Kconfig                              |    2 +-
 net/ipv4/af_inet.c                            |    5 +-
 net/ipv4/inet_connection_sock.c               |   23 +-
 net/ipv4/inet_diag.c                          |    2 -
 net/ipv4/inet_hashtables.c                    |   30 +-
 net/ipv4/inet_timewait_sock.c                 |    4 -
 net/ipv6/af_inet6.c                           |    1 -
 net/ipv6/inet6_connection_sock.c              |    2 -
 net/ipv6/ip6_output.c                         |    2 +-
 samples/bpf/sockex2_kern.c                    |    1 -
 scripts/checkpatch.pl                         |    2 +-
 security/lsm_audit.c                          |   19 -
 security/selinux/hooks.c                      |   41 +-
 security/selinux/include/classmap.h           |    2 -
 security/selinux/nlmsgtab.c                   |    1 -
 security/smack/smack_lsm.c                    |    9 +-
 tools/testing/selftests/net/config            |    1 -
 .../selftests/net/reuseport_addr_any.c        |   36 +-
 89 files changed, 41 insertions(+), 14368 deletions(-)
 delete mode 100644 Documentation/networking/dccp.rst
 delete mode 100644 include/linux/tfrc.h
 delete mode 100644 net/dccp/Kconfig
 delete mode 100644 net/dccp/Makefile
 delete mode 100644 net/dccp/ackvec.c
 delete mode 100644 net/dccp/ackvec.h
 delete mode 100644 net/dccp/ccid.c
 delete mode 100644 net/dccp/ccid.h
 delete mode 100644 net/dccp/ccids/Kconfig
 delete mode 100644 net/dccp/ccids/ccid2.c
 delete mode 100644 net/dccp/ccids/ccid2.h
 delete mode 100644 net/dccp/ccids/ccid3.c
 delete mode 100644 net/dccp/ccids/ccid3.h
 delete mode 100644 net/dccp/ccids/lib/loss_interval.c
 delete mode 100644 net/dccp/ccids/lib/loss_interval.h
 delete mode 100644 net/dccp/ccids/lib/packet_history.c
 delete mode 100644 net/dccp/ccids/lib/packet_history.h
 delete mode 100644 net/dccp/ccids/lib/tfrc.c
 delete mode 100644 net/dccp/ccids/lib/tfrc.h
 delete mode 100644 net/dccp/ccids/lib/tfrc_equation.c
 delete mode 100644 net/dccp/dccp.h
 delete mode 100644 net/dccp/diag.c
 delete mode 100644 net/dccp/feat.c
 delete mode 100644 net/dccp/feat.h
 delete mode 100644 net/dccp/input.c
 delete mode 100644 net/dccp/ipv4.c
 delete mode 100644 net/dccp/ipv6.c
 delete mode 100644 net/dccp/ipv6.h
 delete mode 100644 net/dccp/minisocks.c
 delete mode 100644 net/dccp/options.c
 delete mode 100644 net/dccp/output.c
 delete mode 100644 net/dccp/proto.c
 delete mode 100644 net/dccp/qpolicy.c
 delete mode 100644 net/dccp/sysctl.c
 delete mode 100644 net/dccp/timer.c
 delete mode 100644 net/dccp/trace.h

Comments

Jakub Kicinski April 9, 2025, 1:49 p.m. UTC | #1
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 :)
Kuniyuki Iwashima April 9, 2025, 6:53 p.m. UTC | #2
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<---