From: Mark Hatle <mark.hatle@kernel.crashing.org>
To: yocto-patches@lists.yoctoproject.org
Subject: [pseudo][PATCH 5/6] ports/linux/pseudo_wrappers: Fake seccomp filters set by prctl()
Date: Thu, 12 Nov 2026 10:19:57 -0600 [thread overview]
Message-ID: <1794500398-31706-6-git-send-email-mark.hatle@kernel.crashing.org> (raw)
In-Reply-To: <1794500398-31706-1-git-send-email-mark.hatle@kernel.crashing.org>
From: Mark Hatle <mark.hatle@amd.com>
prctl(PR_SET_SECCOMP) was compared against SECCOMP_SET_MODE_FILTER,
which is the seccomp() system call's value. prctl() takes
SECCOMP_MODE_*, where that value means strict mode, so prctl() filters
were really installed and strict mode was faked by accident. Fake both
SECCOMP_MODE_FILTER and SECCOMP_MODE_STRICT.
AI-Generated: Uses GitHub Copilot
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
---
ports/linux/pseudo_wrappers.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/ports/linux/pseudo_wrappers.c b/ports/linux/pseudo_wrappers.c
index 7d1e7d9..e3cf18b 100644
--- a/ports/linux/pseudo_wrappers.c
+++ b/ports/linux/pseudo_wrappers.c
@@ -240,15 +240,18 @@ prctl(int option, ...) {
return rc;
}
-#ifdef SECCOMP_SET_MODE_FILTER
+#ifdef PR_SET_SECCOMP
/* pseudo and seccomp are incompatible as pseudo uses different syscalls
- * so pretend to enable seccomp but really do nothing */
+ * so pretend to enable seccomp but really do nothing. prctl() takes
+ * SECCOMP_MODE_*, not the SECCOMP_SET_MODE_* values seccomp() takes.
+ */
if (option == PR_SET_SECCOMP) {
unsigned long cmd;
va_start(ap, option);
cmd = va_arg(ap, unsigned long);
va_end(ap);
- if (cmd == SECCOMP_SET_MODE_FILTER) {
+ if (cmd == SECCOMP_MODE_STRICT || cmd == SECCOMP_MODE_FILTER) {
+ pseudo_debug(PDBGF_SYSCALL, "prctl, faking seccomp.\n");
return 0;
}
}
--
1.8.3.1
next prev parent reply other threads:[~2026-11-12 16:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 16:19 [pseudo][PATCH 0/6] Add landlock support, fix seccomp Mark Hatle
2026-11-12 16:19 ` [pseudo][PATCH 1/6] test-landlock: Add a Landlock sandbox test Mark Hatle
2026-11-12 16:19 ` [pseudo][PATCH 2/6] pseudo_client: Connect to the server without changing directory Mark Hatle
2026-11-12 16:19 ` [pseudo][PATCH 3/6] ports/linux/pseudo_wrappers: Report Landlock as unsupported Mark Hatle
2026-11-12 16:19 ` [pseudo][PATCH 4/6] test-seccomp: Check that seccomp is never really enabled Mark Hatle
2026-11-12 16:19 ` Mark Hatle [this message]
2026-11-12 16:19 ` [pseudo][PATCH 6/6] ports/linux/pseudo_wrappers: Fake seccomp strict mode in syscall() Mark Hatle
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=1794500398-31706-6-git-send-email-mark.hatle@kernel.crashing.org \
--to=mark.hatle@kernel.crashing.org \
--cc=yocto-patches@lists.yoctoproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.