linux/net/ipv4/netfilter
Florian Westphal 56c832864e netfilter: nf_reject: don't reply to icmp error messages
[ Upstream commit db99b2f2b3 ]

tcp reject code won't reply to a tcp reset.

But the icmp reject 'netdev' family versions will reply to icmp
dst-unreach errors, unlike icmp_send() and icmp6_send() which are used
by the inet family implementation (and internally by the REJECT target).

Check for the icmp(6) type and do not respond if its an unreachable error.

Without this, something like 'ip protocol icmp reject', when used
in a netdev chain attached to 'lo', cause a packet loop.

Same for two hosts that both use such a rule: each error packet
will be replied to.

Such situation persist until the (bogus) rule is amended to ratelimit or
checks the icmp type before the reject statement.

As the inet versions don't do this make the netdev ones follow along.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-12-07 06:09:21 +09:00
..
arp_tables.c netfilter: complete validation of user input 2024-04-17 11:15:15 +02:00
arpt_mangle.c netfilter: ipv4: prefer skb_ensure_writable 2019-05-31 18:02:46 +02:00
arptable_filter.c netfilter: x_tables: never register tables by default 2021-08-09 10:22:01 +02:00
ip_tables.c netfilter: complete validation of user input 2024-04-17 11:15:15 +02:00
ipt_ah.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ipt_CLUSTERIP.c netfilter: conntrack: Fix data-races around ct mark 2022-12-02 17:41:04 +01:00
ipt_ECN.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-06-22 08:59:24 -04:00
ipt_REJECT.c netfilter: use actual socket sk for REJECT action 2020-12-01 14:33:55 +01:00
ipt_rpfilter.c netfilter: rpfilter/fib: Set ->flowic_uid correctly for user namespaces. 2024-10-17 15:11:57 +02:00
ipt_SYNPROXY.c netfilter: Add MODULE_DESCRIPTION entries to kernel modules 2020-06-25 00:50:31 +02:00
iptable_filter.c netfilter: x_tables: never register tables by default 2021-08-09 10:22:01 +02:00
iptable_mangle.c netfilter: x_tables: handle xt_register_template() returning an error value 2021-08-25 13:06:48 +02:00
iptable_nat.c netfilter: iptables: Fix null-ptr-deref in iptable_nat_table_init(). 2024-08-19 05:45:32 +02:00
iptable_raw.c netfilter: iptable_raw: drop bogus net_init annotation 2021-09-21 03:46:56 +02:00
iptable_security.c netfilter: x_tables: never register tables by default 2021-08-09 10:22:01 +02:00
Kconfig netfilter: nf_log_arp: merge with nf_log_syslog 2021-03-31 00:37:27 +02:00
Makefile netfilter: nf_log_arp: merge with nf_log_syslog 2021-03-31 00:37:27 +02:00
nf_defrag_ipv4.c netfilter: conntrack: fix boot failure with nf_conntrack.enable_hooks=1 2021-09-28 13:04:55 +02:00
nf_dup_ipv4.c netfilter: nf_tables: prevent nf_skb_duplicated corruption 2024-10-17 15:11:20 +02:00
nf_flow_table_ipv4.c netfilter: Add MODULE_DESCRIPTION entries to kernel modules 2020-06-25 00:50:31 +02:00
nf_nat_h323.c netfilter: nf_conntrack_sip: fix expectation clash 2019-07-16 13:16:59 +02:00
nf_nat_pptp.c netfilter: delete repeated words 2020-08-28 20:11:38 +02:00
nf_nat_snmp_basic.asn1 netfilter: nf_nat_snmp_basic: use asn1 decoder library 2018-01-19 13:59:07 +01:00
nf_nat_snmp_basic_main.c netfilter: ipv4: prefer skb_ensure_writable 2019-05-31 18:02:46 +02:00
nf_reject_ipv4.c netfilter: nf_reject: don't reply to icmp error messages 2025-12-07 06:09:21 +09:00
nf_socket_ipv4.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
nf_tproxy_ipv4.c netfilter: tproxy: bail out if IP has been disabled on the device 2024-06-16 13:39:51 +02:00
nft_dup_ipv4.c netfilter: nftables: add nft_parse_register_load() and use it 2021-01-27 22:53:29 +01:00
nft_fib_ipv4.c netfilter: fib: check correct rtable in vrf setups 2024-10-17 15:11:57 +02:00
nft_reject_ipv4.c netfilter: nf_tables: add and use nft_sk helper 2021-05-29 01:04:53 +02:00