public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next 0/2] selftests/bpf: Test BTF sanitization
@ 2026-04-08 10:53 Alan Maguire
  2026-04-08 10:53 ` [PATCH v2 bpf-next 1/2] libbpf: Allow use of feature cache for non-token cases Alan Maguire
  2026-04-08 10:53 ` [PATCH v2 bpf-next 2/2] selftests/bpf: Add BTF sanitize test covering BTF layout Alan Maguire
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Maguire @ 2026-04-08 10:53 UTC (permalink / raw)
  To: andrii
  Cc: ast, daniel, martin.lau, eddyz87, memxor, song, yonghong.song,
	jolsa, bpf, Alan Maguire

Allow simulation of missing BPF features through provision of
a synthetic feature cache set, and use this to simulate case
where FEAT_BTF_LAYOUT is missing.  Ensure sanitization leaves us
with expected BTF (layout info removed, layout header fields
zeroed, strings data adjusted).

Specifying a feature cache with selected missing features will
allow testing of other missing feature codepaths, but for now
add BTF layout sanitization test only.

Changes since v1 [1]:

- renamed to bpf_object_set_feat_cache() (Andrii, patch 1)
- remove __packed, relocate skeleton open/load, fix formatting
  issues (Andrii, patch 2)

[1] https://lore.kernel.org/bpf/20260401164302.3844142-1-alan.maguire@oracle.com/

Alan Maguire (2):
  libbpf: Allow use of feature cache for non-token cases
  selftests/bpf: Add BTF sanitize test covering BTF layout

 tools/lib/bpf/libbpf.c                        |  12 ++-
 tools/lib/bpf/libbpf_internal.h               |   3 +-
 .../selftests/bpf/prog_tests/btf_sanitize.c   | 100 ++++++++++++++++++
 3 files changed, 112 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/btf_sanitize.c

-- 
2.39.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-08 13:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 10:53 [PATCH v2 bpf-next 0/2] selftests/bpf: Test BTF sanitization Alan Maguire
2026-04-08 10:53 ` [PATCH v2 bpf-next 1/2] libbpf: Allow use of feature cache for non-token cases Alan Maguire
2026-04-08 13:37   ` Jiri Olsa
2026-04-08 10:53 ` [PATCH v2 bpf-next 2/2] selftests/bpf: Add BTF sanitize test covering BTF layout Alan Maguire
2026-04-08 12:53   ` Chengkaitao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox