On 3/2/23 6:42 PM, Alexei Starovoitov wrote: > On Thu, Mar 2, 2023 at 3:35 PM Dave Marchevsky <davemarchevsky@xxxxxx> wrote: >> >> diff --git a/tools/testing/selftests/bpf/progs/rbtree_fail.c b/tools/testing/selftests/bpf/progs/rbtree_fail.c >> index bf3cba115897..4614cd7bfa46 100644 >> --- a/tools/testing/selftests/bpf/progs/rbtree_fail.c >> +++ b/tools/testing/selftests/bpf/progs/rbtree_fail.c >> @@ -232,8 +232,9 @@ long rbtree_api_first_release_unlock_escape(void *ctx) >> >> bpf_spin_lock(&glock); >> res = bpf_rbtree_first(&groot); >> - if (res) >> - n = container_of(res, struct node_data, node); >> + if (!res) >> + return 1; >> + n = container_of(res, struct node_data, node); >> bpf_spin_unlock(&glock); > > It has the same issue. > I don't think we should rely on the order of basic blocks. > If 'return 1' block is happened to be a fallthrough > the verifier will error on 'lock is still held'. Whoops! I understand what you mean now. The issue is that I'm returning w/o unlocking here.