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

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.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent a8f12572
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);