]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf,x86: add fsession support for x86_64
authorMenglong Dong <menglong8.dong@gmail.com>
Sat, 24 Jan 2026 06:20:02 +0000 (14:20 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 25 Jan 2026 02:49:36 +0000 (18:49 -0800)
commit98770bd4e6df50db81cbdf5876f8836baefa3005
tree568caf39efa30fa242f677469014193cdba362dc
parent37c7ba1b39c493229d1b3c1f6ab466a23362e21e
bpf,x86: add fsession support for x86_64

Add BPF_TRACE_FSESSION supporting to x86_64, including:

1. clear the return value in the stack before fentry to make the fentry
   of the fsession can only get 0 with bpf_get_func_ret().

2. clear all the session cookies' value in the stack.

2. store the index of the cookie to ctx[-1] before the calling to fsession

3. store the "is_return" flag to ctx[-1] before the calling to fexit of
   the fsession.

Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Co-developed-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Link: https://lore.kernel.org/r/20260124062008.8657-8-dongml2@chinatelecom.cn
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/x86/net/bpf_jit_comp.c