Kees Cook
0638dcc7e7
treewide: Remove uninitialized_var() usage
commit 3f649ab728cda8038259d8f14492fe400fbab911 upstream.
Using uninitialized_var() is dangerous as it papers over real bugs[1]
(or can in the future), and suppresses unrelated compiler warnings
(e.g. "unused variable"). If the compiler thinks it is uninitialized,
either simply initialize the variable or make compiler changes.
In preparation for removing[2] the[3] macro[4], remove all remaining
needless uses with the following script:
git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \
xargs perl -pi -e \
's/\buninitialized_var\(([^\)]+)\)/\1/g;
s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;'
drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid
pathological white-space.
No outstanding warnings were found building allmodconfig with GCC 9.3.0
for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64,
alpha, and m68k.
[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/
[3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/
[4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/
Reviewed-by: Leon Romanovsky <[email protected]> # drivers/infiniband and mlx4/mlx5
Acked-by: Jason Gunthorpe <[email protected]> # IB
Acked-by: Kalle Valo <[email protected]> # wireless drivers
Reviewed-by: Chao Yu <[email protected]> # erofs
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
2023-06-09 10:29:01 +02:00 |
| .. |
|
bpfilter
|
|
|
|
netfilter
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
af_inet.c
|
tcp: deny tcp_disconnect() when threads are waiting
|
2023-06-09 10:28:53 +02: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
|
|
|
|
fib_frontend.c
|
ipv4: Fix incorrect table ID in IOCTL path
|
2023-03-22 13:28:06 +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: Fix incorrect route flushing when source address is deleted
|
2023-02-22 12:50:38 +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
|
|
|
|
gre_demux.c
|
|
|
|
gre_offload.c
|
|
|
|
icmp.c
|
icmp: guard against too small mtu
|
2023-04-20 12:07:33 +02:00 |
|
igmp.c
|
igmp: Fix data-races around sysctl_igmp_qrv.
|
2022-08-03 11:59:39 +02:00 |
|
inet_connection_sock.c
|
tcp: deny tcp_disconnect() when threads are waiting
|
2023-06-09 10:28:53 +02: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
|
inet: fix fast path in __inet_hash_connect()
|
2023-03-11 16:43:55 +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
|
ip_gre, ip6_gre: Fix race condition on o_seqno in collect_md mode
|
2023-05-30 12:44:05 +01: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: Fix potential uninit variable access bug in __ip_make_skb()
|
2023-05-17 11:35:45 +02:00 |
|
ip_sockglue.c
|
ipv{4,6}/raw: fix output xfrm lookup wrt protocol
|
2023-06-05 08:17:33 +02:00 |
|
ip_tunnel.c
|
net: tunnels: annotate lockless accesses to dev->needed_headroom
|
2023-03-22 13:28:05 +01:00 |
|
ip_tunnel_core.c
|
|
|
|
ip_vti.c
|
|
|
|
ipcomp.c
|
|
|
|
ipconfig.c
|
|
|
|
ipip.c
|
|
|
|
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
|
|
|
|
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
|
ipv{4,6}/raw: fix output xfrm lookup wrt protocol
|
2023-06-05 08:17:33 +02:00 |
|
raw_diag.c
|
|
|
|
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: Return user_mss for TCP_MAXSEG in CLOSE/LISTEN state if user_mss set
|
2023-06-09 10:28:53 +02:00 |
|
tcp_bbr.c
|
|
|
|
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
|
|
|
|
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: tcp_check_req() can be called from process context
|
2023-03-11 16:44:12 +01:00 |
|
tcp_nv.c
|
|
|
|
tcp_offload.c
|
|
|
|
tcp_output.c
|
tcp: tcp_make_synack() can be called from process context
|
2023-03-22 13:28:04 +01: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
|
tcp/udp: Call inet6_destroy_sock() in IPv6 sk->sk_destruct().
|
2023-04-26 11:24:05 +02:00 |
|
udp_diag.c
|
|
|
|
udp_impl.h
|
|
|
|
udp_offload.c
|
|
|
|
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
|
udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated().
|
2023-05-30 12:44:09 +01:00 |
|
xfrm4_input.c
|
|
|
|
xfrm4_output.c
|
|
|
|
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
|
|
|