Files
kernel_xiaomi_mt6781/include/uapi/linux
Hao Luo fae103ddcc UPSTREAM: bpf: Introduce pseudo_btf_id
Pseudo_btf_id is a type of ld_imm insn that associates a btf_id to a
ksym so that further dereferences on the ksym can use the BTF info
to validate accesses. Internally, when seeing a pseudo_btf_id ld insn,
the verifier reads the btf_id stored in the insn[0]'s imm field and
marks the dst_reg as PTR_TO_BTF_ID. The btf_id points to a VAR_KIND,
which is encoded in btf_vminux by pahole. If the VAR is not of a struct
type, the dst reg will be marked as PTR_TO_MEM instead of PTR_TO_BTF_ID
and the mem_size is resolved to the size of the VAR's type.

>From the VAR btf_id, the verifier can also read the address of the
ksym's corresponding kernel var from kallsyms and use that to fill
dst_reg.

Therefore, the proper functionality of pseudo_btf_id depends on (1)
kallsyms and (2) the encoding of kernel global VARs in pahole, which
should be available since pahole v1.18.

Change-Id: I8e81d1d9c2ed4c669e5f68fcf4246b9c1c705bb6
Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200929235049.2533242-2-haoluo@google.com
2025-09-20 03:22:32 +01:00
..
2020-06-07 13:17:54 +02:00
2018-08-06 10:24:33 +02:00
2018-08-22 10:52:49 -07:00
2025-09-20 03:22:32 +01:00
2019-09-23 14:11:59 -07:00
2019-08-13 17:07:25 +08:00
2018-08-03 10:03:57 -07:00
2024-06-02 20:01:37 +01:00
2020-05-28 12:20:38 +02:00
2023-06-21 15:39:57 +02:00
2020-01-09 15:11:34 -08:00
2023-09-23 10:48:08 +02:00
2021-12-15 13:45:50 +08:00