bpf: preserve sleepable bit in subprog info
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 14 Mar 2024 00:01:27 +0000 (17:01 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 15 Mar 2024 02:28:16 +0000 (19:28 -0700)
Copy over main program's sleepable bit into subprog's info. This might
be important for, e.g., freplace cases.

Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Stanislav Fomichev <sdf@google.com>
Message-ID: <20240314000127.3881569-1-andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c

index 63749ad5ac6b8d63f108b92690897f032c7eacb6..7b208e5d38f65f79a259d78de50cfc428e08add4 100644 (file)
@@ -19158,6 +19158,7 @@ static int jit_subprogs(struct bpf_verifier_env *env)
                if (bpf_prog_calc_tag(func[i]))
                        goto out_free;
                func[i]->is_func = 1;
+               func[i]->sleepable = prog->sleepable;
                func[i]->aux->func_idx = i;
                /* Below members will be freed only at prog->aux */
                func[i]->aux->btf = prog->aux->btf;