linux/tools/testing
Kumar Kartikeya Dwivedi 0288ed6748
selftests/bpf: Check local object ownership depth
Build raw program BTF records to exercise local object ownership without
constructing a runtime chain deep enough to threaten the kernel stack.

Cover referenced-kptr and percpu-kptr self-cycles, a two-type cycle, and a
cycle mixing a graph root with a referenced kptr. The existing graph-only
check accepts these local-kptr cycles and over-limit kptr chains; the fix
rejects them with -ELOOP.

Pin the eight-record depth boundary with a terminal plain object. Exercise
both parent-first and child-first BTF orders, and a shared suffix reached
first through a shorter path. These cases require cached suffix depths to
be checked against the remaining depth budget on each path.

Check list and rbtree chains of three, four, eight, and nine types. This
covers the old graph-only depth boundary and the new explicit bound. The
existing linked-list BTF tests still reject pure graph cycles and now accept
the longer acyclic layouts previously rejected by the conservative rule.

Although bpf_percpu_obj_new() currently rejects types with special fields,
require the percpu cycle to fail at BTF load so future support cannot bypass
the ownership bound. Keep a positive control for a non-owning kptr, which
remains outside the ownership graph.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260914132444.2564218-3-memxor@gmail.com
2026-09-19 05:26:43 +00:00
..
crypto/chacha20-s390 crypto: drbg - Fold include/crypto/drbg.h into crypto/drbg.c 2026-05-07 16:09:59 +08:00
cxl Merge branch 'for-7.3/cxl-misc' into cxl-for-next 2026-08-05 13:23:52 -07:00
fault-injection
ktest ktest: Add logfile to failure directory 2026-04-20 15:23:13 -04:00
kunit spi: Updates for v7.3 2026-08-19 09:47:41 -07:00
memblock kho: make boot time huge page allocation work nicely with KHO 2026-08-23 09:17:38 -07:00
nvdimm nvdimm: ndtest: remove redundant NULL check before vfree() 2026-07-14 16:12:53 -07:00
radix-tree maple_tree: change two GFP flags in tests 2026-08-24 18:43:31 -07:00
rbtree
scatterlist
selftests selftests/bpf: Check local object ownership depth 2026-09-19 05:26:43 +00:00
shared mm/slab: improve kmem_cache_alloc_bulk 2026-06-03 18:20:43 +02:00
vma mm: fix CONFIG_STACK_GROWSUP typo in tools/testing/vma/include/dup.h 2026-08-24 18:43:12 -07:00
vsock vsock/test: add test for small packets under pressure 2026-07-21 12:11:06 +02:00