aya-rs / bpf-linker

Simple BPF static linker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BTF type name is too long

qjerome opened this issue · comments

On some kernels, BTF aware programs fails to load because BTF type name is too long.
Before kernel 6.1 maximum name length is 128 bytes, which might quickly get overflown when dealing with Rust namespaces.
After kernel 6.1 the maximum length is 512 bytes, which is less prone to overflow.

Anyway, there is a strong need to control the maximum length returned by sanitize_type_name function to maximize program compatibility.

Example:
[220] STRUCT LruHashMap_3C_u128_2C__20_kunai_common_3A__3A_events_3A__3A_Event_3C_kunai_common_3A__3A_events_3A__3A_execve_3A__3A_ExecveData_3E__3E_ size=28 vlen=3 Invalid name