diff options
| author | Alexei Starovoitov <ast@kernel.org> | 2026-10-02 12:47:04 +0000 |
|---|---|---|
| committer | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-10-03 16:08:17 +0200 |
| commit | bed1986a1932942e9db17fbdb2a19d0c4160a1f5 (patch) | |
| tree | 0a53b5efad4ba264aa687a41b0edb2b912a35559 /include/linux/timerqueue.h | |
| parent | b233f937b98f8e5c88e2978ef36321f888076274 (diff) | |
| download | linux-next-bed1986a1932942e9db17fbdb2a19d0c4160a1f5.tar.gz linux-next-bed1986a1932942e9db17fbdb2a19d0c4160a1f5.zip | |
bpf: Allow names of Rust types and functions in BTF
Names of types and functions in BTF that LLVM makes for a Rust program
are not C identifiers:
[69] STRUCT 'NonNull<str>' size=16 vlen=1
[147] FUNC 'write_fmt<scx_cosmos::BpfStream>' type_id=146
and the kernel rejects such BTF with "Invalid name". scx_simple and
scx_cosmos schedulers written in Rust have them in STRUCT, FWD and FUNC,
made of letters, digits and " #&()*,:;<>[]{}", 430 characters at most.
Allow any printable character in btf_name_valid_identifier(), like it's
done for DATASEC. It checks names of types, functions, members,
enumerators, variables and arguments, so all of them can have such
characters now. The limit of KSYM_NAME_LEN stays.
The name of FUNC is a part of the name of the program in kallsyms, where
a space would break the parsers. Replace what is not a character of
an identifier with '_' there.
Tests in prog_tests/btf.c expect "Invalid name" for names with '!' and
'*', which are valid now. Put a character that is not printable there.
The type name '?foo' is expected to load.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20261002124714.180012-6-alexei.starovoitov@gmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
