linux/tools/testing/selftests/exec
Christian Brauner f2b69ea2d1
selftests/exec: test the pre-opened interpreter limit
- an interpreter opened at registration is charged
- an interpreter a 'B' entry binds is charged too
- an entry that opens none is not
- removing an entry gives the charge back
- a nested user namespace cannot buy itself budget by raising its own limit

Skips where the sysctl or binfmt_misc is missing. The 'B' case lives in
binfmt_misc_bpf.c because binding needs a handler. It binds from a child
in a user namespace of its own, through the fd the child inherited, so
the charge lands on the child while the interpreter is still opened with
the entry file's credentials, and nothing outside the child sees a
changed limit.

Link: https://patch.msgid.link/20260803-work-binfmt_misc-interplimit-v1-2-4a2435500bd9@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-03 23:36:18 +02:00
..
.gitignore selftests/exec: test the pre-opened interpreter limit 2026-08-03 23:36:18 +02:00
binfmt_bind_interp.c selftests/exec: test interpreters bound to a 'B' entry 2026-08-03 19:15:44 +02:00
binfmt_bpf_app.c selftests/exec: add binfmt_misc bpf-backed handler test 2026-08-03 10:08:42 +02:00
binfmt_bpf_interp.c selftests/exec: add binfmt_misc bpf-backed handler test 2026-08-03 10:08:42 +02:00
binfmt_loader_payload.c selftests/exec: test binfmt_misc loader substitution 2026-08-03 10:08:47 +02:00
binfmt_misc_bpf.c selftests/exec: test the pre-opened interpreter limit 2026-08-03 23:36:18 +02:00
binfmt_misc_common.h selftests/exec: test registering an entry disabled 2026-08-03 19:15:44 +02:00
binfmt_misc_disabled.c selftests/exec: test registering an entry disabled 2026-08-03 19:15:44 +02:00
binfmt_misc_interplimit.c selftests/exec: test the pre-opened interpreter limit 2026-08-03 23:36:18 +02:00
binfmt_misc_loader.c selftests/exec: test binfmt_misc loader substitution 2026-08-03 10:08:47 +02:00
binfmt_misc_selfpin.c selftests/exec: check that a binfmt_misc instance cannot be pinned 2026-08-03 10:08:49 +02:00
binfmt_misc_transparent.c selftests/exec: let binfmt_flag_supported() return a bool 2026-08-03 19:15:44 +02:00
binfmt_script.py selftests/exec: binfmt_script: Add the overall result line according to TAP 2024-03-13 11:53:45 -07:00
binfmt_transparent_interp.c selftests/exec: test the transparent binfmt_misc mode 2026-08-03 10:08:46 +02:00
bpf_interp.bpf.c selftests/exec: add binfmt_misc bpf-backed handler test 2026-08-03 10:08:42 +02:00
check-exec-tests.sh samples/check-exec: Add an enlighten "inc" interpreter and 28 tests 2024-12-18 17:00:29 -08:00
check-exec.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
config selftests/exec: check that a binfmt_misc instance cannot be pinned 2026-08-03 10:08:49 +02:00
execveat.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
false.c selftests/exec: Add 32 tests for AT_EXECVE_CHECK and exec securebits 2024-12-18 17:00:29 -08:00
interp_bind.bpf.c selftests/exec: test interpreters bound to a 'B' entry 2026-08-03 19:15:44 +02:00
load_address.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
loader.bpf.c selftests/exec: test binfmt_misc loader substitution 2026-08-03 10:08:47 +02:00
Makefile selftests/exec: test the pre-opened interpreter limit 2026-08-03 23:36:18 +02:00
nix_origin.bpf.c selftests/exec: add binfmt_misc bpf-backed handler test 2026-08-03 10:08:42 +02:00
non-regular.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
null-argv.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
recursion-depth.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
transparent.bpf.c selftests/exec: test the transparent binfmt_misc mode 2026-08-03 10:08:46 +02:00