]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: Add syscall common attributes support for btf_load
authorLeon Hwang <leon.hwang@linux.dev>
Tue, 12 May 2026 15:31:54 +0000 (23:31 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 12 May 2026 19:44:43 +0000 (12:44 -0700)
commitceeb7eda94a3548958b30818495ef7eb12898727
tree0c3a5d83c87a28af3595aede06c02e3271694826
parentac89d33fdd8183df39fe92ffa525be7af6feb9d1
bpf: Add syscall common attributes support for btf_load

BPF_BTF_LOAD can now take log parameters from both union bpf_attr and
struct bpf_common_attr, with the same merge rules as BPF_PROG_LOAD:

- if both sides provide a complete log tuple (buf/size/level) and they
  match, use it;
- if only one side provides log parameters, use that one;
- if both sides provide complete tuples but they differ, return -EINVAL.

Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Link: https://lore.kernel.org/r/20260512153157.28382-6-leon.hwang@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/btf.h
kernel/bpf/btf.c
kernel/bpf/syscall.c