Commit d128860d authored by Artem Savkov's avatar Artem Savkov Committed by Alexei Starovoitov

selftests/bpf: fix unpriv_disabled check in test_verifier

Commit 1d56ade0 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: 1d56ade0 ("selftests/bpf: Unprivileged tests for test_loader.c")
Signed-off-by: default avatarArtem Savkov <asavkov@redhat.com>
Acked-by: default avatarEduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20230912120631.213139-1-asavkov@redhat.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent a8f12572
......@@ -1880,7 +1880,7 @@ int main(int argc, char **argv)
}
}
get_unpriv_disabled();
unpriv_disabled = get_unpriv_disabled();
if (unpriv && unpriv_disabled) {
printf("Cannot run as unprivileged user with sysctl %s.\n",
UNPRIV_SYSCTL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment