Commit 717d6313 authored by Jiri Olsa's avatar Jiri Olsa Committed by Daniel Borkmann

bpf: Change bpf_session_cookie return value to __u64 *

This reverts [1] and changes return value for bpf_session_cookie
in bpf selftests. Having long * might lead to problems on 32-bit
architectures.

Fixes: 2b8dd873 ("bpf: Make bpf_session_cookie() kfunc return long *")
Suggested-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240619081624.1620152-1-jolsa@kernel.org
parent 1ae7a19e
......@@ -3530,7 +3530,7 @@ __bpf_kfunc bool bpf_session_is_return(void)
return session_ctx->is_return;
}
__bpf_kfunc long *bpf_session_cookie(void)
__bpf_kfunc __u64 *bpf_session_cookie(void)
{
struct bpf_session_run_ctx *session_ctx;
......
......@@ -77,5 +77,5 @@ extern int bpf_verify_pkcs7_signature(struct bpf_dynptr *data_ptr,
struct bpf_key *trusted_keyring) __ksym;
extern bool bpf_session_is_return(void) __ksym __weak;
extern long *bpf_session_cookie(void) __ksym __weak;
extern __u64 *bpf_session_cookie(void) __ksym __weak;
#endif
......@@ -25,7 +25,7 @@ int BPF_PROG(trigger)
static int check_cookie(__u64 val, __u64 *result)
{
long *cookie;
__u64 *cookie;
if (bpf_get_current_pid_tgid() >> 32 != pid)
return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment