From: Alexei Starovoitov test_alloc_double_release has two errors: it releases the cpumask twice and it does not check create_cpumask() for NULL. The test expects the message for the first one: R1 type=scalar expected=ptr_, trusted_ptr_, rcu_ptr_ GCC gives the path with NULL its own copy of the two calls. The verifier gets there first and says: Possibly NULL pointer passed to trusted R1 The prog is rejected with both compilers. Expect GCC's message with GCC. Fixes: dd43eeaf99eb ("selftests/bpf: Adjust tests to new verdicts, messages and order") Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/progs/cpumask_failure.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/cpumask_failure.c b/tools/testing/selftests/bpf/progs/cpumask_failure.c index 715218d32105..2a58209eb8be 100644 --- a/tools/testing/selftests/bpf/progs/cpumask_failure.c +++ b/tools/testing/selftests/bpf/progs/cpumask_failure.c @@ -45,7 +45,12 @@ int BPF_PROG(test_alloc_no_release, struct task_struct *task, u64 clone_flags) } SEC("tp_btf/task_newtask") +#ifdef __clang__ __failure __msg("R1 type=scalar expected=ptr_, trusted_ptr_, rcu_ptr_") +#else +/* no check for NULL either: in GCC's layout the verifier gets there first */ +__failure __msg("NULL pointer passed to trusted R1") +#endif int BPF_PROG(test_alloc_double_release, struct task_struct *task, u64 clone_flags) { struct bpf_cpumask *cpumask;