netfilter: conntrack: remove DCCP protocol support
Subsystems (12)
Pablo Neira Ayuso
maintainerPATCH v2 1/1 netfilter: conntrack: remove DCCP protocol support
The DCCP socket family has now been removed from this tree, see:
8bb3212be4b4 ("Merge branch 'net-retire-dccp-socket'")
Remove connection tracking and NAT support for this protocol, this should not pose a problem because no DCCP traffic is expected to be seen on the wire.
As for the code for matching on dccp header for iptables and nftables, mark it as deprecated and keep it in place. Ruleset restoration is an atomic operation. Without dccp matching support, an astray match on dccp could break this operation leaving your computer with no policy in place, so let's follow a more conservative approach for matches.
Add CONFIG_NFT_EXTHDR_DCCP which is set to 'n' by default to deprecate dccp extension support. Similarly, label CONFIG_NETFILTER_XT_MATCH_DCCP as deprecated too and also set it to 'n' by default.
Code to match on DCCP protocol from ebtables also remains in place, this is just a few checks on IPPROTO_DCCP from _check() path which is exercised when ruleset is loaded. There is another use of IPPROTO_DCCP from the _check() path in the iptables multiport match. Another check for IPPROTO_DCCP from the packet in the reject target is also removed.
So let's schedule removal of the dccp matching for a second stage, this should not interfer with the dccp retirement since this is only matching on the dccp header.
---
v2: remove superfluous exception with ct expectation objects.
.../networking/nf_conntrack-sysctl.rst | 1 - arch/arm/configs/omap2plus_defconfig | 1 - arch/loongarch/configs/loongson3_defconfig | 1 - arch/m68k/configs/amiga_defconfig | 1 - arch/m68k/configs/apollo_defconfig | 1 - arch/m68k/configs/atari_defconfig | 1 - arch/m68k/configs/bvme6000_defconfig | 1 - arch/m68k/configs/hp300_defconfig | 1 - arch/m68k/configs/mac_defconfig | 1 - arch/m68k/configs/multi_defconfig | 1 - arch/m68k/configs/mvme147_defconfig | 1 - arch/m68k/configs/mvme16x_defconfig | 1 - arch/m68k/configs/q40_defconfig | 1 - arch/m68k/configs/sun3_defconfig | 1 - arch/m68k/configs/sun3x_defconfig | 1 - arch/mips/configs/fuloong2e_defconfig | 1 - arch/mips/configs/ip22_defconfig | 1 - arch/mips/configs/loongson2k_defconfig | 1 - arch/mips/configs/loongson3_defconfig | 1 - arch/mips/configs/malta_defconfig | 1 - arch/mips/configs/malta_kvm_defconfig | 1 - arch/mips/configs/maltaup_xpa_defconfig | 1 - arch/mips/configs/rb532_defconfig | 1 - arch/mips/configs/rm200_defconfig | 1 - arch/powerpc/configs/cell_defconfig | 1 - arch/s390/configs/debug_defconfig | 1 - arch/s390/configs/defconfig | 1 - arch/sh/configs/titan_defconfig | 1 - include/linux/netfilter/nf_conntrack_dccp.h | 38 - .../net/netfilter/ipv4/nf_conntrack_ipv4.h | 3 - include/net/netfilter/nf_conntrack.h | 2 - include/net/netfilter/nf_conntrack_l4proto.h | 13 - include/net/netfilter/nf_reject.h | 1 - include/net/netns/conntrack.h | 13 - net/netfilter/Kconfig | 20 +- net/netfilter/Makefile | 1 - net/netfilter/nf_conntrack_core.c | 8 - net/netfilter/nf_conntrack_netlink.c | 1 - net/netfilter/nf_conntrack_proto.c | 6 - net/netfilter/nf_conntrack_proto_dccp.c | 826 ------------------ net/netfilter/nf_conntrack_standalone.c | 92 -- net/netfilter/nf_nat_core.c | 6 - net/netfilter/nf_nat_proto.c | 43 - net/netfilter/nfnetlink_cttimeout.c | 5 - net/netfilter/nft_exthdr.c | 8 + 45 files changed, 16 insertions(+), 1098 deletions(-) delete mode 100644 include/linux/netfilter/nf_conntrack_dccp.h delete mode 100644 net/netfilter/nf_conntrack_proto_dccp.c
Documentation/networking/nf_conntrack-sysctl.rst +0 -1
@@ -85,7 +85,6 @@ nf_conntrack_log_invalid - INTEGER - 1 - log ICMP packets - 6 - log TCP packets - 17 - log UDP packets - - 33 - log DCCP packets - 41 - log ICMPv6 packets - 136 - log UDPLITE packets - 255 - log packets of any protocol
arch/arm/configs/omap2plus_defconfig +0 -1
@@ -142,7 +142,6 @@ CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m CONFIG_NETFILTER_XT_MATCH_CPU=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m
arch/loongarch/configs/loongson3_defconfig +0 -1
@@ -225,7 +225,6 @@ CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m CONFIG_NETFILTER_XT_MATCH_CPU=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m
arch/m68k/configs/amiga_defconfig +0 -1
@@ -85,7 +85,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/apollo_defconfig +0 -1
@@ -81,7 +81,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/atari_defconfig +0 -1
@@ -88,7 +88,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/bvme6000_defconfig +0 -1
@@ -78,7 +78,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/hp300_defconfig +0 -1
@@ -80,7 +80,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/mac_defconfig +0 -1
@@ -79,7 +79,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/multi_defconfig +0 -1
@@ -99,7 +99,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/mvme147_defconfig +0 -1
@@ -77,7 +77,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/mvme16x_defconfig +0 -1
@@ -78,7 +78,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/q40_defconfig +0 -1
@@ -79,7 +79,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/sun3_defconfig +0 -1
@@ -74,7 +74,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/m68k/configs/sun3x_defconfig +0 -1
@@ -75,7 +75,6 @@ CONFIG_NETFILTER=y CONFIG_NETFILTER_NETLINK_HOOK=m CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_ZONES=y -# CONFIG_NF_CT_PROTO_DCCP is not set CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m
arch/mips/configs/fuloong2e_defconfig +0 -1
@@ -44,7 +44,6 @@ CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_TARGET_TRACE=m CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_IPRANGE=m CONFIG_NETFILTER_XT_MATCH_LENGTH=m
arch/mips/configs/ip22_defconfig +0 -1
@@ -79,7 +79,6 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
arch/mips/configs/loongson2k_defconfig +0 -1
@@ -52,7 +52,6 @@ CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m CONFIG_NETFILTER_XT_TARGET_MARK=m CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_LENGTH=m CONFIG_NETFILTER_XT_MATCH_LIMIT=m
arch/mips/configs/loongson3_defconfig +0 -1
@@ -72,7 +72,6 @@ CONFIG_NETFILTER_XT_TARGET_MARK=m CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_LENGTH=m CONFIG_NETFILTER_XT_MATCH_LIMIT=m
arch/mips/configs/malta_defconfig +0 -1
@@ -80,7 +80,6 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m CONFIG_NETFILTER_XT_MATCH_HELPER=m
arch/mips/configs/malta_kvm_defconfig +0 -1
@@ -84,7 +84,6 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m CONFIG_NETFILTER_XT_MATCH_HELPER=m
arch/mips/configs/maltaup_xpa_defconfig +0 -1
@@ -82,7 +82,6 @@ CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m CONFIG_NETFILTER_XT_MATCH_HELPER=m
arch/mips/configs/rb532_defconfig +0 -1
@@ -56,7 +56,6 @@ CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_TARGET_TRACE=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m CONFIG_NETFILTER_XT_MATCH_LIMIT=y CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
arch/mips/configs/rm200_defconfig +0 -1
@@ -64,7 +64,6 @@ CONFIG_NETFILTER_XT_MATCH_COMMENT=m CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
arch/powerpc/configs/cell_defconfig +0 -1
@@ -62,7 +62,6 @@ CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_TARGET_TCPMSS=m CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
arch/s390/configs/debug_defconfig +0 -1
@@ -248,7 +248,6 @@ CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m CONFIG_NETFILTER_XT_MATCH_CPU=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m
arch/s390/configs/defconfig +0 -1
@@ -239,7 +239,6 @@ CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m CONFIG_NETFILTER_XT_MATCH_CPU=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m
arch/sh/configs/titan_defconfig +0 -1
@@ -61,7 +61,6 @@ CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m CONFIG_NETFILTER_XT_TARGET_MARK=m CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m -CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_LENGTH=m CONFIG_NETFILTER_XT_MATCH_LIMIT=m
include/linux/netfilter/nf_conntrack_dccp.h deleted +0 -38
@@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _NF_CONNTRACK_DCCP_H -#define _NF_CONNTRACK_DCCP_H - -/* Exposed to userspace over nfnetlink */ -enum ct_dccp_states { -CT_DCCP_NONE , -CT_DCCP_REQUEST , -CT_DCCP_RESPOND , -CT_DCCP_PARTOPEN , -CT_DCCP_OPEN , -CT_DCCP_CLOSEREQ , -CT_DCCP_CLOSING , -CT_DCCP_TIMEWAIT , -CT_DCCP_IGNORE , -CT_DCCP_INVALID , - __CT_DCCP_MAX -}; -#define CT_DCCP_MAX (__CT_DCCP_MAX - 1) - -enum ct_dccp_roles { -CT_DCCP_ROLE_CLIENT , -CT_DCCP_ROLE_SERVER , - __CT_DCCP_ROLE_MAX -}; -#define CT_DCCP_ROLE_MAX (__CT_DCCP_ROLE_MAX - 1) - -#include <linux/netfilter/nf_conntrack_tuple_common.h> - -struct nf_ct_dccp { -u_int8_t role[IP_CT_DIR_MAX ]; -u_int8_t state; -u_int8_t last_pkt; -u_int8_t last_dir; -u_int64_t handshake_seq; -}; - -#endif /* _NF_CONNTRACK_DCCP_H */
include/net/netfilter/ipv4/nf_conntrack_ipv4.h +0 -3
@@ -13,9 +13,6 @@extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp;extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_udp;extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp; -#ifdef CONFIG_NF_CT_PROTO_DCCP -extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp; -#endif #ifdef CONFIG_NF_CT_PROTO_SCTP extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp;#endif
include/net/netfilter/nf_conntrack.h +0 -2
@@ -18,7 +18,6 @@#include <linux/netfilter/nf_conntrack_common.h> #include <linux/netfilter/nf_conntrack_tcp.h> -#include <linux/netfilter/nf_conntrack_dccp.h> #include <linux/netfilter/nf_conntrack_sctp.h> #include <linux/netfilter/nf_conntrack_proto_gre.h>
@@ -31,7 +30,6 @@ struct nf_ct_udp {/* per conntrack: protocol private data */ union nf_conntrack_proto {/* insert conntrack proto private data here */ -struct nf_ct_dccp dccp;struct ip_ct_sctp sctp;struct ip_ct_tcp tcp;struct nf_ct_udp udp;
include/net/netfilter/nf_conntrack_l4proto.h +0 -13
@@ -117,11 +117,6 @@ int nf_conntrack_tcp_packet(struct nf_conn *ct,unsigned int dataoff, enum ip_conntrack_info ctinfo, const struct nf_hook_state *state); -int nf_conntrack_dccp_packet (struct nf_conn *ct, -struct sk_buff *skb, -unsigned int dataoff, -enum ip_conntrack_info ctinfo, -const struct nf_hook_state *state); int nf_conntrack_sctp_packet(struct nf_conn *ct, struct sk_buff *skb, unsigned int dataoff,
@@ -137,7 +132,6 @@ void nf_conntrack_generic_init_net(struct net *net);void nf_conntrack_tcp_init_net (struct net *net);void nf_conntrack_udp_init_net (struct net *net);void nf_conntrack_gre_init_net (struct net *net); -void nf_conntrack_dccp_init_net (struct net *net);void nf_conntrack_sctp_init_net (struct net *net);void nf_conntrack_icmp_init_net (struct net *net);void nf_conntrack_icmpv6_init_net (struct net *net);
@@ -223,13 +217,6 @@ static inline bool nf_conntrack_tcp_established(const struct nf_conn *ct) }#endif -#ifdef CONFIG_NF_CT_PROTO_DCCP -static inline struct nf_dccp_net *nf_dccp_pernet (struct net *net) -{ -return &net->ct.nf_ct_proto.dccp; -} -#endif -#ifdef CONFIG_NF_CT_PROTO_SCTP static inline struct nf_sctp_net *nf_sctp_pernet (struct net *net) {
include/net/netfilter/nf_reject.h +0 -1
@@ -34,7 +34,6 @@ static inline bool nf_reject_verify_csum(struct sk_buff *skb, int dataoff,/* Protocols with partial checksums. */ case IPPROTO_UDPLITE : -case IPPROTO_DCCP :return false; }return true;
include/net/netns/conntrack.h +0 -13
@@ -7,9 +7,6 @@#include <linux/atomic.h> #include <linux/workqueue.h> #include <linux/netfilter/nf_conntrack_tcp.h> -#ifdef CONFIG_NF_CT_PROTO_DCCP -#include <linux/netfilter/nf_conntrack_dccp.h> -#endif #ifdef CONFIG_NF_CT_PROTO_SCTP #include <linux/netfilter/nf_conntrack_sctp.h> #endif
@@ -50,13 +47,6 @@ struct nf_icmp_net {unsigned int timeout; }; -#ifdef CONFIG_NF_CT_PROTO_DCCP -struct nf_dccp_net { -u8 dccp_loose; -unsigned int dccp_timeout[CT_DCCP_MAX +1 ]; -}; -#endif - #ifdef CONFIG_NF_CT_PROTO_SCTP struct nf_sctp_net { unsigned int timeouts[SCTP_CONNTRACK_MAX];
@@ -82,9 +72,6 @@ struct nf_ip_net {struct nf_udp_net udp;struct nf_icmp_net icmp;struct nf_icmp_net icmpv6; -#ifdef CONFIG_NF_CT_PROTO_DCCP -struct nf_dccp_net dccp; -#endif #ifdef CONFIG_NF_CT_PROTO_SCTP struct nf_sctp_net sctp;#endif
net/netfilter/Kconfig +8 -12
@@ -195,16 +195,6 @@ config NF_CONNTRACK_LABELS config NF_CONNTRACK_OVS bool -config NF_CT_PROTO_DCCP - bool 'DCCP protocol connection tracking support' - depends on NETFILTER_ADVANCED - default y - help - With this option enabled, the layer 3 independent connection - tracking code will be able to do state tracking on DCCP connections. - - If unsure, say Y. - config NF_CT_PROTO_GRE bool
@@ -516,6 +506,12 @@ config NFT_CT This option adds the "ct" expression that you can use to match connection tracking information such as the flow state. +config NFT_EXTHDR_DCCP + bool "Netfilter nf_tables exthdr DCCP support (DEPRECATED)" + default n + help + This option adds support for matching on DCCP extension headers. + config NFT_FLOW_OFFLOAD depends on NF_CONNTRACK && NF_FLOW_TABLE tristate "Netfilter nf_tables hardware flow offload module"
@@ -1278,9 +1274,9 @@ config NETFILTER_XT_MATCH_CPU To compile it as a module, choose M here. If unsure, say N. config NETFILTER_XT_MATCH_DCCP - tristate '"dccp" protocol match support' + tristate '"dccp" protocol match support (DEPRECATED)' depends on NETFILTER_ADVANCED - default IP_DCCP + default n help With this option enabled, you will be able to use the iptables `dccp' match in order to match on DCCP source/destination ports
net/netfilter/Makefile +0 -1
@@ -12,7 +12,6 @@ nf_conntrack-$(CONFIG_NF_CONNTRACK_TIMESTAMP) += nf_conntrack_timestamp.o nf_conntrack-$(CONFIG_NF_CONNTRACK_EVENTS) += nf_conntrack_ecache.o nf_conntrack-$(CONFIG_NF_CONNTRACK_LABELS) += nf_conntrack_labels.o nf_conntrack-$(CONFIG_NF_CONNTRACK_OVS) += nf_conntrack_ovs.o -nf_conntrack-$(CONFIG_NF_CT_PROTO_DCCP) += nf_conntrack_proto_dccp.o nf_conntrack-$(CONFIG_NF_CT_PROTO_SCTP) += nf_conntrack_proto_sctp.o nf_conntrack-$(CONFIG_NF_CT_PROTO_GRE) += nf_conntrack_proto_gre.o ifeq ($(CONFIG_NF_CONNTRACK),m)
net/netfilter/nf_conntrack_core.c +0 -8
@@ -328,9 +328,6 @@ nf_ct_get_tuple(const struct sk_buff *skb,#endif #ifdef CONFIG_NF_CT_PROTO_SCTP case IPPROTO_SCTP : -#endif -#ifdef CONFIG_NF_CT_PROTO_DCCP -case IPPROTO_DCCP :#endif /* fallthrough */ return nf_ct_get_tuple_ports (skb, dataoff, tuple);
@@ -1977,11 +1974,6 @@ static int nf_conntrack_handle_packet(struct nf_conn *ct,return nf_conntrack_sctp_packet (ct, skb, dataoff, ctinfo, state);#endif -#ifdef CONFIG_NF_CT_PROTO_DCCP -case IPPROTO_DCCP : -return nf_conntrack_dccp_packet (ct, skb, dataoff, - ctinfo, state); -#endif #ifdef CONFIG_NF_CT_PROTO_GRE case IPPROTO_GRE : return nf_conntrack_gre_packet(ct, skb, dataoff,
net/netfilter/nf_conntrack_netlink.c +0 -1
@@ -2036,7 +2036,6 @@ static void ctnetlink_change_mark(struct nf_conn *ct,static const struct nla_policy protoinfo_policy[CTA_PROTOINFO_MAX +1 ] = { [CTA_PROTOINFO_TCP ] = { .type =NLA_NESTED }, - [CTA_PROTOINFO_DCCP ] = { .type =NLA_NESTED }, [CTA_PROTOINFO_SCTP ] = { .type =NLA_NESTED }, };
net/netfilter/nf_conntrack_proto.c +0 -6
@@ -100,9 +100,6 @@ const struct nf_conntrack_l4proto *nf_ct_l4proto_find(u8 l4proto)case IPPROTO_UDP :return &nf_conntrack_l4proto_udp;case IPPROTO_TCP :return &nf_conntrack_l4proto_tcp;case IPPROTO_ICMP :return &nf_conntrack_l4proto_icmp; -#ifdef CONFIG_NF_CT_PROTO_DCCP -case IPPROTO_DCCP :return &nf_conntrack_l4proto_dccp; -#endif #ifdef CONFIG_NF_CT_PROTO_SCTP case IPPROTO_SCTP :return &nf_conntrack_l4proto_sctp;#endif
@@ -681,9 +678,6 @@ void nf_conntrack_proto_pernet_init(struct net *net)#if IS_ENABLED (CONFIG_IPV6 )nf_conntrack_icmpv6_init_net (net);#endif -#ifdef CONFIG_NF_CT_PROTO_DCCP -nf_conntrack_dccp_init_net (net); -#endif #ifdef CONFIG_NF_CT_PROTO_SCTP nf_conntrack_sctp_init_net (net);#endif
net/netfilter/nf_conntrack_proto_dccp.c deleted +0 -826
826 lines not on this page · raw message
net/netfilter/nf_conntrack_standalone.c +0 -92
128 lines not on this page · raw message
net/netfilter/nf_nat_core.c +0 -6
@@ -69,7 +69,6 @@ static void nf_nat_ipv4_decode_session(struct sk_buff *skb,if (t->dst.protonum ==IPPROTO_TCP || t->dst.protonum ==IPPROTO_UDP || t->dst.protonum ==IPPROTO_UDPLITE || - t->dst.protonum ==IPPROTO_DCCP || t->dst.protonum ==IPPROTO_SCTP ) fl4->fl4_dport = t->dst.u.all; }
@@ -81,7 +80,6 @@ static void nf_nat_ipv4_decode_session(struct sk_buff *skb,if (t->dst.protonum ==IPPROTO_TCP || t->dst.protonum ==IPPROTO_UDP || t->dst.protonum ==IPPROTO_UDPLITE || - t->dst.protonum ==IPPROTO_DCCP || t->dst.protonum ==IPPROTO_SCTP ) fl4->fl4_sport = t->src.u.all; }
@@ -102,7 +100,6 @@ static void nf_nat_ipv6_decode_session(struct sk_buff *skb,if (t->dst.protonum ==IPPROTO_TCP || t->dst.protonum ==IPPROTO_UDP || t->dst.protonum ==IPPROTO_UDPLITE || - t->dst.protonum ==IPPROTO_DCCP || t->dst.protonum ==IPPROTO_SCTP ) fl6->fl6_dport = t->dst.u.all; }
@@ -114,7 +111,6 @@ static void nf_nat_ipv6_decode_session(struct sk_buff *skb,if (t->dst.protonum ==IPPROTO_TCP || t->dst.protonum ==IPPROTO_UDP || t->dst.protonum ==IPPROTO_UDPLITE || - t->dst.protonum ==IPPROTO_DCCP || t->dst.protonum ==IPPROTO_SCTP ) fl6->fl6_sport = t->src.u.all; }
@@ -426,7 +422,6 @@ static bool l4proto_in_range(const struct nf_conntrack_tuple *tuple,case IPPROTO_TCP :case IPPROTO_UDP :case IPPROTO_UDPLITE : -case IPPROTO_DCCP :case IPPROTO_SCTP :if (maniptype ==NF_NAT_MANIP_SRC ) port = tuple->src.u.all;
@@ -626,7 +621,6 @@ static void nf_nat_l4proto_unique_tuple(struct nf_conntrack_tuple *tuple,case IPPROTO_UDPLITE :case IPPROTO_TCP :case IPPROTO_SCTP : -case IPPROTO_DCCP :if (maniptype ==NF_NAT_MANIP_SRC ) keyptr = &tuple->src.u.all;else
net/netfilter/nf_nat_proto.c +0 -43
55 lines not on this page · raw message
net/netfilter/nfnetlink_cttimeout.c +0 -5
@@ -461,11 +461,6 @@ static int cttimeout_default_get(struct sk_buff *skb,case IPPROTO_UDPLITE : timeouts =nf_udp_pernet (info->net)->timeouts;break ; -case IPPROTO_DCCP : -#ifdef CONFIG_NF_CT_PROTO_DCCP - timeouts =nf_dccp_pernet (info->net)->dccp_timeout; -#endif -break ;case IPPROTO_ICMPV6 : timeouts = &nf_icmpv6_pernet (info->net)->timeout;break ;
net/netfilter/nft_exthdr.c +8 -0
@@ -407,6 +407,7 @@ static void nft_exthdr_sctp_eval(const struct nft_expr *expr, regs->verdict.code =NFT_BREAK ; } +#ifdef CONFIG_NFT_EXTHDR_DCCP static void nft_exthdr_dccp_eval (const struct nft_expr *expr,struct nft_regs *regs,const struct nft_pktinfo *pkt)
@@ -482,6 +483,7 @@ static void nft_exthdr_dccp_eval(const struct nft_expr *expr, err: *dest =0 ; } +#endif static const struct nla_policy nft_exthdr_policy[NFTA_EXTHDR_MAX +1 ] = { [NFTA_EXTHDR_DREG ] = { .type =NLA_U32 },
@@ -634,6 +636,7 @@ static int nft_exthdr_ipv4_init(const struct nft_ctx *ctx,return 0 ; } +#ifdef CONFIG_NFT_EXTHDR_DCCP static int nft_exthdr_dccp_init (const struct nft_ctx *ctx,const struct nft_expr *expr,const struct nlattr *const tb[])
@@ -649,6 +652,7 @@ static int nft_exthdr_dccp_init(const struct nft_ctx *ctx, return 0; } +#endif static int nft_exthdr_dump_common (struct sk_buff *skb,const struct nft_exthdr *priv) {
@@ -779,6 +783,7 @@ static const struct nft_expr_ops nft_exthdr_sctp_ops = { .reduce = nft_exthdr_reduce, }; +#ifdef CONFIG_NFT_EXTHDR_DCCP static const struct nft_expr_ops nft_exthdr_dccp_ops = { .type = &nft_exthdr_type, .size = NFT_EXPR_SIZE(sizeof(struct nft_exthdr)),
@@ -787,6 +792,7 @@ static const struct nft_expr_ops nft_exthdr_dccp_ops = { .dump = nft_exthdr_dump, .reduce = nft_exthdr_reduce, }; +#endif static const struct nft_expr_ops * nft_exthdr_select_ops(const struct nft_ctx *ctx,
@@ -822,10 +828,12 @@ nft_exthdr_select_ops(const struct nft_ctx *ctx,if (tb[NFTA_EXTHDR_DREG ])return &nft_exthdr_sctp_ops;break ; +#ifdef CONFIG_NFT_EXTHDR_DCCP case NFT_EXTHDR_OP_DCCP :if (tb[NFTA_EXTHDR_DREG ])return &nft_exthdr_dccp_ops;break ; +#endif }return ERR_PTR (-EOPNOTSUPP );
Signature · 1 line
2.30.2
Quoted 18 lines · Pablo Neira Ayuso
The DCCP socket family has now been removed from this tree, see:
8bb3212be4b4("Merge branch 'net-retire-dccp-socket'")Remove connection tracking and NAT support for this protocol, this should not pose a problem because no DCCP traffic is expected to be seen on the wire.
As for the code for matching on dccp header for iptables and nftables, mark it as deprecated and keep it in place. Ruleset restoration is an atomic operation. Without dccp matching support, an astray match on dccp could break this operation leaving your computer with no policy in place, so let's follow a more conservative approach for matches.
Add
CONFIG_NFT_EXTHDR_DCCPwhich is set to 'n' by default to deprecate dccp extension support. Similarly, labelCONFIG_NETFILTER_XT_MATCH_DCCPas deprecated too and also set it to 'n' by default.
Quoted 8 lines
Code to match on DCCP protocol from ebtables also remains in place, this is just a few checks on
IPPROTO_DCCPfrom_check()path which is exercised when ruleset is loaded. There is another use ofIPPROTO_DCCPfrom the_check()path in the iptables multiport match. Another check forIPPROTO_DCCPfrom the packet in the reject target is also removed.So let's schedule removal of the dccp matching for a second stage, this should not interfer with the dccp retirement since this is only matching
nit: interfere
Quoted 11 lines
on the dccp header.
Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>Cc Simon Horman <[email protected]>Cc Kuniyuki Iwashima <[email protected]>Signed-off-by Pablo Neira Ayuso <[email protected]>---
v2: remove superfluous exception with ct expectation objects.