diff options
| author | Kees Cook <kees@kernel.org> | 2026-10-06 01:41:05 -0700 |
|---|---|---|
| committer | Kees Cook <kees@kernel.org> | 2026-10-06 01:58:47 -0700 |
| commit | 9e9bd8f8ac02012176f9da75823c030e2c5f4bbc (patch) | |
| tree | 004ec95de607612a466306fa165774757347a511 /kernel | |
| parent | c96a4cb2c8bab0c62e1cd1bc0cebac213bdb7d7d (diff) | |
seccomp: Document RESTART_BEFORE_RECV and O_PATH addfd
Describe SECCOMP_FILTER_FLAG_RESTART_BEFORE_RECV in the UAPI header, as
SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV is described above it, and say in
the documentation that supervisors must tolerate ENOENT from
SECCOMP_IOCTL_NOTIF_RECV, which the flag makes routine. Note at the
fget_raw() call that O_PATH files are allowed on purpose.
Build tested ARCH=x86_64 defconfig (kernel/seccomp.o and headers) with
GCC 16.2.0, and SPHINXDIRS=userspace-api htmldocs.
Assisted-by: LLM
Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/seccomp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/seccomp.c b/kernel/seccomp.c index e6e1feed0e7b..3eecba5ccdef 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -1743,6 +1743,7 @@ static long seccomp_notify_addfd(struct seccomp_filter *filter, if (addfd.newfd && !(addfd.flags & SECCOMP_ADDFD_FLAG_SETFD)) return -EINVAL; + /* Allow O_PATH files, as SCM_RIGHTS and pidfd_getfd() do. */ kaddfd.file = fget_raw(addfd.srcfd); if (!kaddfd.file) return -EBADF; |
