Skip to content

Commit d128860

Browse files
sm00thAlexei Starovoitov
authored andcommitted
selftests/bpf: fix unpriv_disabled check in test_verifier
Commit 1d56ade changed the function get_unpriv_disabled() to return its results as a bool instead of updating a global variable, but test_verifier was not updated to keep in line with these changes. Thus unpriv_disabled is always false in test_verifier and unprivileged tests are not properly skipped on systems with unprivileged bpf disabled. Fixes: 1d56ade ("selftests/bpf: Unprivileged tests for test_loader.c") Signed-off-by: Artem Savkov <asavkov@redhat.com> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20230912120631.213139-1-asavkov@redhat.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent a8f1257 commit d128860

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/bpf/test_verifier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1880,7 +1880,7 @@ int main(int argc, char **argv)
18801880
}
18811881
}
18821882

1883-
get_unpriv_disabled();
1883+
unpriv_disabled = get_unpriv_disabled();
18841884
if (unpriv && unpriv_disabled) {
18851885
printf("Cannot run as unprivileged user with sysctl %s.\n",
18861886
UNPRIV_SYSCTL);

0 commit comments

Comments
 (0)