WSL2-Linux-Kernel/net/ipv6/netfilter
Eric Dumazet 97dab36e57 netfilter: complete validation of user input
[ Upstream commit 65acf6e0501ac8880a4f73980d01b5d27648b956 ]

In my recent commit, I missed that do_replace() handlers
use copy_from_sockptr() (which I fixed), followed
by unsafe copy_from_sockptr_offset() calls.

In all functions, we can perform the @optlen validation
before even calling xt_alloc_table_info() with the following
check:

if ((u64)optlen < (u64)tmp.size + sizeof(tmp))
        return -EINVAL;

Fixes: 0c83842df40f ("netfilter: validate user input for expected length")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Link: https://lore.kernel.org/r/20240409120741.3538135-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-17 11:15:15 +02:00
..
Kconfig netfilter: nf_log_ipv6: merge with nf_log_syslog 2021-03-31 00:37:27 +02:00
Makefile netfilter: nf_log_ipv6: merge with nf_log_syslog 2021-03-31 00:37:27 +02:00
ip6_tables.c netfilter: complete validation of user input 2024-04-17 11:15:15 +02:00
ip6t_NPT.c netfilter: ip6t_NPT: rewrite addresses in ICMPv6 original packet 2020-08-28 19:18:48 +02:00
ip6t_REJECT.c netfilter: use actual socket sk for REJECT action 2020-12-01 14:33:55 +01:00
ip6t_SYNPROXY.c netfilter: Add MODULE_DESCRIPTION entries to kernel modules 2020-06-25 00:50:31 +02:00
ip6t_ah.c netfilter: ip6tables: Remove redundant null checks 2020-07-29 20:39:43 +02:00
ip6t_eui64.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ip6t_frag.c netfilter: ip6tables: Remove redundant null checks 2020-07-29 20:39:43 +02:00
ip6t_hbh.c netfilter: ip6tables: Remove redundant null checks 2020-07-29 20:39:43 +02:00
ip6t_ipv6header.c netfilter: move inline nf_ip6_ext_hdr() function to a more appropriate header. 2019-09-13 12:34:09 +02:00
ip6t_mh.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ip6t_rpfilter.c netfilter: Fix rpfilter dropping vrf packets by mistake 2019-07-16 13:16:47 +02:00
ip6t_rt.c netfilter: ip6t_rt: fix rt0_hdr parsing in rt_mt6 2021-10-14 23:08:35 +02:00
ip6t_srh.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ip6table_filter.c netfilter: x_tables: never register tables by default 2021-08-09 10:22:01 +02:00
ip6table_mangle.c netfilter: x_tables: never register tables by default 2021-08-09 10:22:01 +02:00
ip6table_nat.c netfilter: x_tables: never register tables by default 2021-08-09 10:22:01 +02:00
ip6table_raw.c netfilter: x_tables: never register tables by default 2021-08-09 10:22:01 +02:00
ip6table_security.c netfilter: x_tables: never register tables by default 2021-08-09 10:22:01 +02:00
nf_conntrack_reasm.c netfilter: conntrack: fix boot failure with nf_conntrack.enable_hooks=1 2021-09-28 13:04:55 +02:00
nf_defrag_ipv6_hooks.c netfilter: conntrack: fix boot failure with nf_conntrack.enable_hooks=1 2021-09-28 13:04:55 +02:00
nf_dup_ipv6.c netfilter: drop bridge nf reset from nf_reset 2019-10-01 18:42:15 +02:00
nf_flow_table_ipv6.c netfilter: Add MODULE_DESCRIPTION entries to kernel modules 2020-06-25 00:50:31 +02:00
nf_reject_ipv6.c netfilter: let reset rules clean out conntrack entries 2024-03-06 14:38:46 +00:00
nf_socket_ipv6.c netfilter: socket: icmp6: fix use-after-scope 2021-09-03 18:25:31 +02:00
nf_tproxy_ipv6.c netfilter: tproxy: fix deadlock due to missing BH disable 2023-03-17 08:48:55 +01:00
nft_dup_ipv6.c netfilter: nftables: add nft_parse_register_load() and use it 2021-01-27 22:53:29 +01:00
nft_fib_ipv6.c netfilter: nft_fib: Fix for rpath check with VRF devices 2022-10-26 12:34:47 +02:00
nft_reject_ipv6.c netfilter: nf_tables: add and use nft_sk helper 2021-05-29 01:04:53 +02:00