linux/tools
Willem de Bruijn 00a4f8fd9c selftests/net: mptcp: fix uninitialized variable warnings
Same init_rng() in both tests. The function reads /dev/urandom to
initialize srand(). In case of failure, it falls back onto the
entropy in the uninitialized variable. Not sure if this is on purpose.
But failure reading urandom should be rare, so just fail hard. While
at it, convert to getrandom(). Which man 4 random suggests is simpler
and more robust.

    mptcp_inq.c:525:6:
    mptcp_connect.c:1131:6:

    error: variable 'foo' is used uninitialized
    whenever 'if' condition is false
    [-Werror,-Wsometimes-uninitialized]

Fixes: 048d19d444 ("mptcp: add basic kselftest for mptcp")
Fixes: b51880568f ("selftests: mptcp: add inq test case")
Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: Willem de Bruijn <willemb@google.com>

----

When input is randomized because this is expected to meaningfully
explore edge cases, should we also add
1. logging the random seed to stdout and
2. adding a command line argument to replay from a specific seed
I can do this in net-next, if authors find it useful in this case.
Reviewed-by: Matthieu Baerts <matttbe@kernel.org>

Link: https://lore.kernel.org/r/20231124171645.1011043-5-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-11-27 18:12:07 -08:00
..
accounting
arch ARM: 2023-11-02 15:45:15 -10:00
bootconfig
bpf bpftool: Extend net dump with netkit progs 2023-10-24 16:07:32 -07:00
build perf tools fixes for v6.6: 2nd batch 2023-10-30 13:46:27 -07:00
certs
cgroup
counter
crypto/ccp
debugging
edid
firewire
firmware
gpio
hv hv/hv_kvp_daemon: Some small fixes for handling NM keyfiles 2023-11-10 23:27:46 +00:00
iio tools: iio: iio_generic_buffer ensure alignment 2023-10-05 16:16:20 +01:00
include perf tools changes for v6.7 2023-11-03 08:17:38 -10:00
kvm/kvm_stat
laptop
leds
lib perf tools changes for v6.7 2023-11-03 08:17:38 -10:00
memory-model
mm tools/mm: update the usage output to be more organized 2023-10-18 14:34:19 -07:00
net/ynl tools: ynl: fix duplicate op name in devlink 2023-11-23 08:52:23 -08:00
objtool * Refactor and clean up TDX hypercall/module call infrastructure 2023-11-01 10:28:32 -10:00
pci
pcmcia
perf perf tools changes for v6.7 2023-11-03 08:17:38 -10:00
power turbostat-2023.11.07 2023-11-18 09:09:17 -08:00
rcu
scripts tools/build: Fix -s detection code in tools/scripts/Makefile.include 2023-10-18 15:29:47 -07:00
spi
testing selftests/net: mptcp: fix uninitialized variable warnings 2023-11-27 18:12:07 -08:00
thermal tools/thermal: Remove unused 'mds' and 'nrhandler' variables 2023-10-15 23:40:10 +02:00
time
tracing rtla: Fix uninitialized variable found 2023-10-30 19:00:12 +01:00
usb
verification verification/dot2k: Delete duplicate imports 2023-10-30 16:59:12 +01:00
virtio tools/virtio: Add dma sync api for virtio test 2023-10-16 05:32:23 -04:00
wmi
workqueue
Makefile