From: Thomas Gleixner <tglx@kernel.org>
To: Gregory Price <gourry@gourry.net>, linux-kernel@vger.kernel.org
Cc: linux-doc@vger.kernel.org, corbet@lwn.net,
skhan@linuxfoundation.org, peterz@infradead.org, luto@kernel.org,
akpm@linux-foundation.org, feng.tang@linux.alibaba.com,
pmladek@suse.com, lance.yang@linux.dev,
marc.herbert@linux.intel.com, kees@kernel.org, leitao@debian.org,
gourry@gourry.net, joel.granados@kernel.org,
lirongqing@baidu.com, nathan@kernel.org, xur@google.com,
lukas.bulwahn@redhat.com, ryan.roberts@arm.com
Subject: Re: [PATCH v2 2/2] syscall_user_dispatch: add kernel.syscall_user_dispatch sysctl
Date: Sun, 05 Jul 2026 22:35:08 +0200 [thread overview]
Message-ID: <87ldbpjhtv.ffs@fw13> (raw)
In-Reply-To: <20260704015859.536580-3-gourry@gourry.net>
On Fri, Jul 03 2026 at 21:58, Gregory Price wrote:
> --- a/kernel/entry/syscall_user_dispatch.c
> +++ b/kernel/entry/syscall_user_dispatch.c
> @@ -11,12 +11,15 @@
> #include <linux/uaccess.h>
> #include <linux/signal.h>
> #include <linux/elf.h>
> +#include <linux/sysctl.h>
It's already not ordered correctly, but the rule is that we fix up the
include order to alphabetic ordering when we touch it.
> #include <linux/sched/signal.h>
> #include <linux/sched/task_stack.h>
>
> #include <asm/syscall.h>
>
> +static int syscall_user_dispatch_allowed __read_mostly = 1;
> +
> static void trigger_sigsys(struct pt_regs *regs)
> {
> struct kernel_siginfo info;
> @@ -102,6 +105,10 @@ static int task_set_syscall_user_dispatch(struct task_struct *task, unsigned lon
> return -EINVAL;
> }
>
> + /* Arming can be denied at runtime via sysctl, disarming is allowed */
> + if (mode != PR_SYS_DISPATCH_OFF && !syscall_user_dispatch_allowed)
> + return -EPERM;
> +
> /*
> * access_ok() will clear memory tags for tagged addresses
> * if current has memory tagging enabled.
> @@ -172,3 +179,24 @@ int syscall_user_dispatch_set_config(struct task_struct *task, unsigned long siz
> return task_set_syscall_user_dispatch(task, cfg.mode, cfg.offset, cfg.len,
> (char __user *)(uintptr_t)cfg.selector);
> }
> +
> +#ifdef CONFIG_SYSCTL
> +static const struct ctl_table syscall_user_dispatch_sysctls[] = {
> + {
> + .procname = "syscall_user_dispatch",
> + .data = &syscall_user_dispatch_allowed,
> + .maxlen = sizeof(syscall_user_dispatch_allowed),
> + .mode = 0644,
> + .proc_handler = proc_dointvec_minmax,
proc_dobool() exists for a reason.
next prev parent reply other threads:[~2026-07-05 20:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-04 1:58 [PATCH v2 0/2] syscall_user_dispatch: add build/runtime configs Gregory Price
2026-07-04 1:58 ` [PATCH v2 1/2] syscall_user_dispatch: Make it configurable in Kconfig Gregory Price
2026-07-04 15:22 ` Matthew Wilcox
2026-07-04 15:29 ` Gregory Price
2026-07-05 21:49 ` Randy Dunlap
2026-07-06 0:11 ` Gregory Price
2026-07-05 20:31 ` Thomas Gleixner
2026-07-06 0:10 ` Gregory Price
2026-07-04 1:58 ` [PATCH v2 2/2] syscall_user_dispatch: add kernel.syscall_user_dispatch sysctl Gregory Price
2026-07-05 20:35 ` Thomas Gleixner [this message]
2026-07-06 0:07 ` Gregory Price
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=87ldbpjhtv.ffs@fw13 \
--to=tglx@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=feng.tang@linux.alibaba.com \
--cc=gourry@gourry.net \
--cc=joel.granados@kernel.org \
--cc=kees@kernel.org \
--cc=lance.yang@linux.dev \
--cc=leitao@debian.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=lukas.bulwahn@redhat.com \
--cc=luto@kernel.org \
--cc=marc.herbert@linux.intel.com \
--cc=nathan@kernel.org \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=ryan.roberts@arm.com \
--cc=skhan@linuxfoundation.org \
--cc=xur@google.com \
/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