]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: use the least significant byte for the nr_args in trampoline
authorMenglong Dong <menglong8.dong@gmail.com>
Sat, 24 Jan 2026 06:19:57 +0000 (14:19 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 25 Jan 2026 02:49:35 +0000 (18:49 -0800)
commitf1b56b3cbdb2d2a51d8ea91008eddf4d1d9f277b
tree278c3302c1a897f73434ebc772ef57d7ec1472e4
parent2d419c44658f75e7655794341a95c0687830f3df
bpf: use the least significant byte for the nr_args in trampoline

For now, ((u64 *)ctx)[-1] is used to store the nr_args in the trampoline.
However, 1 byte is enough to store such information. Therefore, we use
only the least significant byte of ((u64 *)ctx)[-1] to store the nr_args,
and reserve the rest for other usages.

Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Link: https://lore.kernel.org/r/20260124062008.8657-3-dongml2@chinatelecom.cn
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c
kernel/trace/bpf_trace.c