mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gabriel Changamire <gaberashawn@gmail.com>
To: Kees Cook <kees@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>, Shuah Khan <shuah@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Randy Dunlap <rdunlap@infradead.org>,
	linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Gabriel Changamire <gaberashawn@gmail.com>
Subject: [PATCH 0/2] seccomp: document and test Seccomp_filters in /proc/PID/status
Date: Wed,  2 Dec 2026 08:13:41 +0000	[thread overview]
Message-ID: <20261202081343.9325-1-gaberashawn@gmail.com> (raw)

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


             reply	other threads:[~2026-12-02  8:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  8:13 Gabriel Changamire [this message]
2026-12-02  8:13 ` [PATCH 1/2] docs: proc: document " Gabriel Changamire
2026-12-02  8:13 ` [PATCH 2/2] selftests/seccomp: test filter reporting " Gabriel Changamire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261202081343.9325-1-gaberashawn@gmail.com \
    --to=gaberashawn@gmail.com \
    --cc=corbet@lwn.net \
    --cc=kees@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=rdunlap@infradead.org \
    --cc=shuah@kernel.org \
    --cc=wad@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®