linux-stable/net/ipv6
Eric Dumazet c760089aa9 netfilter: complete validation of user input
[ Upstream commit 65acf6e050 ]

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: 0c83842df4 ("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:18:25 +02:00
..
ila ila: do not generate empty messages in ila_xlat_nl_cmd_get_mapping() 2023-03-17 08:50:23 +01:00
netfilter netfilter: complete validation of user input 2024-04-17 11:18:25 +02:00
Kconfig
Makefile
addrconf.c ipv6: fix race condition between ipv6_get_ifaddr and ipv6_del_addr 2024-04-17 11:18:24 +02:00
addrconf_core.c ipv6: Ensure natural alignment of const ipv6 loopback and router addresses 2024-02-05 20:13:01 +00:00
addrlabel.c
af_inet6.c bpf: Derive source IP addr via bpf_*_fib_lookup() 2024-03-06 14:45:20 +00:00
ah6.c
anycast.c
calipso.c
datagram.c ipv6: Fix datagram socket connection with DSCP. 2023-02-22 12:59:54 +01:00
esp6.c net: ipv6: fix return value check in esp_remove_trailer 2023-10-25 12:03:06 +02:00
esp6_offload.c xfrm: Linearize the skb after offloading if needed. 2023-06-28 11:12:29 +02:00
exthdrs.c Fix write to cloned skb in ipv6_hop_ioam() 2024-03-01 13:26:38 +01:00
exthdrs_core.c ipv6: Fix out-of-bounds access in ipv6_find_tlv() 2023-05-30 14:03:21 +01:00
exthdrs_offload.c
fib6_notifier.c
fib6_rules.c ipv6: fib6_rules: flush route cache when rule is changed 2024-03-26 18:20:41 -04:00
fou6.c
icmp.c icmp6: Fix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev(). 2023-07-23 13:49:23 +02:00
inet6_connection_sock.c
inet6_hashtables.c
ioam6.c
ioam6_iptunnel.c
ip6_checksum.c
ip6_fib.c ipv6: fib: hide unused 'pn' variable 2024-04-17 11:18:24 +02:00
ip6_flowlabel.c
ip6_gre.c erspan: make sure erspan_base_hdr is present in skb->head 2024-04-10 16:28:27 +02:00
ip6_icmp.c
ip6_input.c ipv6: ignore dst hint for multipath routes 2023-09-19 12:28:01 +02:00
ip6_offload.c
ip6_offload.h
ip6_output.c net: annotate data-races around sk->sk_tsflags 2024-01-10 17:10:23 +01:00
ip6_tunnel.c ip6_tunnel: make sure to pull inner header in __ip6_tnl_rcv() 2024-02-05 20:13:00 +00:00
ip6_udp_tunnel.c
ip6_vti.c ip6_vti: fix slab-use-after-free in decode_session6 2023-08-23 17:52:32 +02:00
ip6mr.c ip6mr: Fix skb_under_panic in ip6mr_cache_report() 2023-08-11 12:08:17 +02:00
ipcomp6.c
ipv6_sockglue.c
mcast.c ipv6: mcast: remove one synchronize_net() barrier in ipv6_mc_down() 2024-03-26 18:20:35 -04:00
mcast_snoop.c
mip6.c
ndisc.c neighbour: annotate lockless accesses to n->nud_state 2023-10-10 22:00:42 +02:00
netfilter.c
output_core.c
ping.c net: annotate data-races around sk->sk_tsflags 2024-01-10 17:10:23 +01:00
proc.c
protocol.c
raw.c net: annotate data-races around sk->sk_tsflags 2024-01-10 17:10:23 +01:00
reassembly.c
route.c net/ipv6: avoid possible UAF in ip6_route_mpath_notify() 2024-03-15 10:48:15 -04:00
rpl.c net: rpl: fix rpl header size calculation 2023-04-26 14:28:34 +02:00
rpl_iptunnel.c
seg6.c ipv6: sr: fix possible use-after-free and null-ptr-deref 2024-03-01 13:26:36 +01:00
seg6_hmac.c
seg6_iptunnel.c
seg6_local.c
sit.c sit: update dev->needed_headroom in ipip6_tunnel_bind_dev() 2023-05-17 11:53:33 +02:00
syncookies.c dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. 2023-11-20 11:52:16 +01:00
sysctl_net_ipv6.c
tcp_ipv6.c ipv4, ipv6: Use splice_eof() to flush 2024-01-10 17:10:27 +01:00
tcpv6_offload.c
tunnel6.c
udp.c udp: do not accept non-tunnel GSO skbs landing in a tunnel 2024-04-10 16:28:27 +02:00
udp_impl.h
udp_offload.c udp: do not transition UDP GRO fraglist partial checksums to unnecessary 2024-04-10 16:28:27 +02:00
udplite.c udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated(). 2023-05-30 14:03:20 +01:00
xfrm6_input.c udp: annotate data-races around udp->encap_type 2024-01-10 17:10:28 +01:00
xfrm6_output.c
xfrm6_policy.c xfrm6: fix inet6_dev refcount underflow problem 2023-10-25 12:03:12 +02:00
xfrm6_protocol.c
xfrm6_state.c
xfrm6_tunnel.c