[PATCH 0/2] seccomp: document and test Seccomp_filters in /proc/PID/status
From: Gabriel Changamire
Date: Wed Dec 02 2026 - 03:14:02 EST
Since v5.9, /proc/PID/status has reported the number of seccomp filters
attached to a task in a Seccomp_filters line. The field is missing from
Documentation/filesystems/proc.rst, and the seccomp selftests never
read /proc/PID/status, so neither the mode nor the filter count shown
there is tested.
Patch 1 documents the field. Patch 2 adds selftests covering the filter
count as filters are attached, its inheritance across fork(), and its
propagation to sibling threads with SECCOMP_FILTER_FLAG_TSYNC.
Kees, if it is convenient for you to take both through the seccomp
tree, that keeps them together; otherwise patch 1 can go through the
documentation tree on its own.
Testing: the new tests pass on a 6.12 kernel both from a process with no
seccomp filter and from inside a container whose runtime already applies
one, which is why the counts are checked against a baseline. I also
changed each expected value to a wrong one to confirm that every test
fails as it should. proc.rst parses with no new docutils warnings.
Gabriel Changamire (2):
docs: proc: document Seccomp_filters in /proc/PID/status
selftests/seccomp: test filter reporting in /proc/PID/status
Documentation/filesystems/proc.rst | 2 +
tools/testing/selftests/seccomp/seccomp_bpf.c | 178 ++++++++++++++++++
2 files changed, 180 insertions(+)
--
2.47.3