linux-stable/net/ipv4
Eric Dumazet 8f0eb24f1a ipv4: prevent potential spectre v1 gadget in fib_metrics_match()
[ Upstream commit 5e9398a26a ]

if (!type)
        continue;
    if (type > RTAX_MAX)
        return false;
    ...
    fi_val = fi->fib_metrics->metrics[type - 1];

@type being used as an array index, we need to prevent
cpu speculation or risk leaking kernel memory content.

Fixes: 5f9ae3d9e7 ("ipv4: do metrics match when looking up and deleting a route")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20230120133140.3624204-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-06 07:52:45 +01:00
..
bpfilter
netfilter netfilter: nft_fib: Fix for rpath check with VRF devices 2022-10-26 13:22:25 +02:00
af_inet.c tcp/udp: Make early_demux back namespacified. 2022-11-10 17:57:55 +01:00
ah4.c
arp.c ipv4: Invalidate neighbour for broadcast address upon address addition 2022-04-15 14:18:33 +02:00
cipso_ipv4.c cipso: Fix data-races around sysctl. 2022-07-21 20:59:20 +02:00
datagram.c
devinet.c net: return correct error code 2021-12-08 09:01:09 +01:00
esp4.c esp: limit skb_page_frag_refill use to a single page 2022-07-12 16:30:45 +02:00
esp4_offload.c esp: delete NETIF_F_SCTP_CRC bit from features for esp offload 2021-04-14 08:24:13 +02:00
fib_frontend.c ipv4: Fix incorrect route flushing when table ID 0 is used 2022-12-14 11:30:47 +01:00
fib_lookup.h
fib_notifier.c
fib_rules.c ipv6: fix memory leak in fib6_rule_suppress 2021-12-08 09:01:13 +01:00
fib_semantics.c ipv4: prevent potential spectre v1 gadget in fib_metrics_match() 2023-02-06 07:52:45 +01:00
fib_trie.c ipv4: Fix a data-race around sysctl_fib_sync_mem. 2022-07-21 20:59:21 +02:00
fou.c fou: Fix IPv6 netlink policy 2020-01-29 16:45:22 +01:00
gre_demux.c erspan: fix version 1 check in gre_parse_header() 2021-01-12 20:16:15 +01:00
gre_offload.c net: gre: recompute gre csum for sctp over gre tunnels 2020-08-11 15:33:40 +02:00
icmp.c ip: Fix data-races around sysctl_ip_no_pmtu_disc. 2022-07-29 17:14:10 +02:00
igmp.c igmp: Fix data-races around sysctl_igmp_qrv. 2022-08-03 11:59:39 +02:00
inet_connection_sock.c net/ulp: prevent ULP without clone op from entering the LISTEN status 2023-01-18 11:42:01 +01:00
inet_diag.c inet_diag: fix kernel-infoleak for UDP sockets 2021-12-22 09:29:36 +01:00
inet_fragment.c inet: frags: annotate races around fqdir->dead and fqdir->high_thresh 2022-01-27 09:19:54 +01:00
inet_hashtables.c tcp: avoid the lookup process failing to get sk in ehash table 2023-02-06 07:52:40 +01:00
inet_timewait_sock.c tcp: avoid the lookup process failing to get sk in ehash table 2023-02-06 07:52:40 +01:00
inetpeer.c inetpeer: Fix data-races around sysctl. 2022-07-21 20:59:20 +02:00
ip_forward.c
ip_fragment.c inet: frags: annotate races around fqdir->dead and fqdir->high_thresh 2022-01-27 09:19:54 +01:00
ip_gre.c erspan: do not assume transport header is always set 2022-06-29 08:58:46 +02:00
ip_input.c tcp/udp: Make early_demux back namespacified. 2022-11-10 17:57:55 +01:00
ip_options.c
ip_output.c ipv4: tcp: send zero IPID in SYNACK messages 2022-02-01 17:24:39 +01:00
ip_sockglue.c
ip_tunnel.c net: Set true network header for ECN decapsulation 2021-08-04 12:27:39 +02:00
ip_tunnel_core.c
ip_vti.c ip_vti: receive ipip packet by calling ip_tunnel_rcv 2020-06-03 08:21:34 +02:00
ipcomp.c
ipconfig.c net: ipconfig: Don't override command-line hostnames or domains 2021-06-18 09:58:59 +02:00
ipip.c net: ipip: fix wrong address family in init error path 2020-06-03 08:20:52 +02:00
ipmr.c ipmr,ip6mr: acquire RTNL before calling ip[6]mr_free_table() on failure path 2022-02-16 12:52:51 +01:00
ipmr_base.c
Kconfig tcp: configurable source port perturb table size 2022-12-08 11:23:00 +01:00
Makefile
metrics.c ipv4: prevent potential spectre v1 gadget in ip_metrics_convert() 2023-02-06 07:52:45 +01:00
netfilter.c netfilter: use actual socket sk rather than skb sk when routing harder 2020-11-18 19:20:17 +01:00
netlink.c
nexthop.c nh: fix scope used to find saddr when adding non gw nh 2022-11-03 23:56:56 +09:00
ping.c ping: fix address binding wrt vrf 2022-05-18 09:47:28 +02:00
proc.c
protocol.c
raw.c ipv4: raw: lock the socket in raw_bind() 2022-02-01 17:24:39 +01:00
raw_diag.c inet_diag: return classid for all socket types 2020-03-18 07:17:38 +01:00
route.c ip: Fix data-races around sysctl_ip_fwd_use_pmtu. 2022-07-29 17:14:10 +02:00
syncookies.c tcp: Fix data-races around sysctl knobs related to SYN option. 2022-07-29 17:14:14 +02:00
sysctl_net_ipv4.c tcp/udp: Make early_demux back namespacified. 2022-11-10 17:57:55 +01:00
tcp.c tcp: fix rate_app_limited to default to 1 2023-02-06 07:52:40 +01:00
tcp_bbr.c tcp_bbr: fix u32 wrap bug in round logic if bbr_init() called after 2B packets 2021-08-18 08:57:01 +02:00
tcp_bic.c
tcp_bpf.c bpf, sockmap: Fix data loss caused by using apply_bytes on ingress redirect 2023-01-18 11:41:08 +01:00
tcp_cdg.c tcp: cdg: allow tcp_cdg_release() to be called multiple times 2022-11-25 17:42:21 +01:00
tcp_cong.c net: Only allow init netns to set default tcp cong to a restricted algo 2021-05-14 09:44:33 +02:00
tcp_cubic.c tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows 2021-12-01 09:23:33 +01:00
tcp_dctcp.c
tcp_dctcp.h
tcp_diag.c
tcp_fastopen.c tcp: Fix data-races around sysctl_tcp_fastopen. 2022-07-29 17:14:13 +02:00
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: fix indefinite deferral of RTO with SACK reneging 2022-11-03 23:56:55 +09:00
tcp_ipv4.c dccp/tcp: Reset saddr on failure after inet6?_hash_connect(). 2022-12-08 11:22:59 +01:00
tcp_lp.c
tcp_metrics.c tcp: Fix a data-race around sysctl_tcp_nometrics_save. 2022-08-03 11:59:38 +02:00
tcp_minisocks.c tcp: Fix a data-race around sysctl_tcp_rfc1337. 2022-07-29 17:14:15 +02:00
tcp_nv.c
tcp_offload.c net, gro: Set inner transport header offset in tcp/udp GRO hook 2021-08-12 13:20:56 +02:00
tcp_output.c tcp: fix tcp_cwnd_validate() to not forget is_cwnd_limited 2022-10-26 13:22:26 +02:00
tcp_rate.c tcp: ensure to use the most recently sent skb when filling the rate sample 2022-05-09 09:03:24 +02:00
tcp_recovery.c tcp: Fix data-races around sysctl_tcp_recovery. 2022-07-29 17:14:15 +02:00
tcp_scalable.c
tcp_timer.c tcp: Fix a data-race around sysctl_tcp_thin_linear_timeouts. 2022-07-29 17:14:15 +02:00
tcp_ulp.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c inet: fully convert sk->sk_rx_dst to RCU rules 2022-10-26 13:23:01 +02:00
udp_diag.c inet_diag: return classid for all socket types 2020-03-18 07:17:38 +01:00
udp_impl.h
udp_offload.c net, gro: Set inner transport header offset in tcp/udp GRO hook 2021-08-12 13:20:56 +02:00
udp_tunnel.c net/tunnel: wait until all sk_user_data reader finish before releasing the sock 2023-01-18 11:41:14 +01:00
udplite.c
xfrm4_input.c
xfrm4_output.c xfrm: Always set XFRM_TRANSFORMED in xfrm{4,6}_output_finish 2020-04-29 16:33:11 +02:00
xfrm4_policy.c
xfrm4_protocol.c net: xfrm: unexport __init-annotated xfrm4_protocol_init() 2022-06-14 18:11:58 +02:00
xfrm4_state.c
xfrm4_tunnel.c