Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Drop unneeded error.h includes

The addition of general support for unprivileged tests in test_loader.c
breaks building test_verifier on non-glibc (e.g. musl) systems, due to the
inclusion of glibc extension '<error.h>' in 'unpriv_helpers.c'. However,
the header is actually not needed, so remove it to restore building.

Similarly for sk_lookup.c and flow_dissector.c, error.h is not necessary
and causes problems, so drop them.

Fixes: 1d56ade032a4 ("selftests/bpf: Unprivileged tests for test_loader.c")
Fixes: 0ab5539f8584 ("selftests/bpf: Tests for BPF_SK_LOOKUP attach point")
Fixes: 0905beec9f52 ("selftests/bpf: run flow dissector tests in skb-less mode")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/5664367edf5fea4f3f4b4aec3b182bcfc6edff9c.1721713597.git.tony.ambardar@gmail.com

authored by

Tony Ambardar and committed by
Andrii Nakryiko
69f40946 7b10f0c2

-3
-1
tools/testing/selftests/bpf/prog_tests/flow_dissector.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <test_progs.h> 3 3 #include <network_helpers.h> 4 - #include <error.h> 5 4 #include <linux/if_tun.h> 6 5 #include <sys/uio.h> 7 6
-1
tools/testing/selftests/bpf/prog_tests/sk_lookup.c
··· 18 18 #include <arpa/inet.h> 19 19 #include <assert.h> 20 20 #include <errno.h> 21 - #include <error.h> 22 21 #include <fcntl.h> 23 22 #include <sched.h> 24 23 #include <stdio.h>
-1
tools/testing/selftests/bpf/unpriv_helpers.c
··· 2 2 3 3 #include <stdbool.h> 4 4 #include <stdlib.h> 5 - #include <error.h> 6 5 #include <stdio.h> 7 6 #include <string.h> 8 7 #include <unistd.h>