]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
bpf: Make bpf_session_cookie() kfunc return long *
authorDaniel Xu <dxu@dxuuu.xyz>
Wed, 12 Jun 2024 15:58:30 +0000 (09:58 -0600)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 12 Jun 2024 18:01:31 +0000 (11:01 -0700)
We will soon be generating kfunc prototypes from BTF. As part of that,
we need to align the manual signatures in bpf_kfuncs.h with the actual
kfunc definitions. There is currently a conflicting signature for
bpf_session_cookie() w.r.t. return type.

The original intent was to return long * and not __u64 *. You can see
evidence of that intent in a3a5113393cc ("selftests/bpf: Add kprobe
session cookie test").

Fix conflict by changing kfunc definition.

Fixes: 5c919acef851 ("bpf: Add support for kprobe session cookie")
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Link: https://lore.kernel.org/r/7043e1c251ab33151d6e3830f8ea1902ed2604ac.1718207789.git.dxu@dxuuu.xyz
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/trace/bpf_trace.c

index d1daeab1bbc141df37023a2f1c683ec7268b732e..bc16e21a2a4438741f4e34905a8742e98d59c006 100644 (file)
@@ -3527,7 +3527,7 @@ __bpf_kfunc bool bpf_session_is_return(void)
        return session_ctx->is_return;
 }
 
-__bpf_kfunc __u64 *bpf_session_cookie(void)
+__bpf_kfunc long *bpf_session_cookie(void)
 {
        struct bpf_session_run_ctx *session_ctx;