From: Gregory Price <gregory.price@memverge.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Gregory Price <gourry.memverge@gmail.com>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org,
krisman@collabora.com, tglx@linutronix.de, luto@kernel.org,
peterz@infradead.org, ebiederm@xmission.com,
akpm@linux-foundation.org, adobriyan@gmail.com, corbet@lwn.net,
shuah@kernel.org
Subject: Re: [PATCH 3/3] ptrace,syscall_user_dispatch: add a getter/setter for sud configuration
Date: Mon, 23 Jan 2023 13:12:33 -0500 [thread overview]
Message-ID: <Y87OEdDXwZG8pmmE@memverge.com> (raw)
In-Reply-To: <20230123154101.GA6268@redhat.com>
On Mon, Jan 23, 2023 at 04:41:02PM +0100, Oleg Nesterov wrote:
> On 01/22, Gregory Price wrote:
> >
> > +int syscall_user_dispatch_get_config(struct task_struct *task, unsigned long size,
> > + void __user *data)
> > +{
> > + struct syscall_user_dispatch *sd = &task->syscall_dispatch;
> > + struct syscall_user_dispatch_config config;
> > +
> > + if (size != sizeof(struct syscall_user_dispatch_config))
> > + return -EINVAL;
> > +
> > + if (test_syscall_work(SYSCALL_USER_DISPATCH))
> > + config.mode = PR_SYS_DISPATCH_ON;
> > + else
> > + config.mode = PR_SYS_DISPATCH_OFF;
>
> Stupid question...
>
> Why do we need 2/3 (which reports SYSCALL_USER_DISPATCH in proc/pid/status) then?
>
> Oleg.
>
Actually a good question.
My original though was: CRIU uses proc/status to determine whether to
use seccomp dumping, so i may as well implement the same thing.
On further thought, I think you're right. We can just always read and
set these settings regardless of the original state because SUD is not
seccomp.
1. if GENERIC_ENTRY is not compiled, and TIF_SYSCALL_USER_DISPATCH is
not available, these settings get ignored anyway.
2. if disabled, offset/len/selector is guaranteed to be off
3. if you try to set something other than the above then this will fail
anyway (see: set_syscall_user_dispatch)
ergo
4. It's always say to read/write these settings. As with anything else
you can certainly cause the user program to crash by setting garbage
but that's to be expected.
So i think dropping 2/3 in the list is good. If you concur i'll do
that.
next prev parent reply other threads:[~2023-01-23 18:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-23 3:29 [PATCH v5 0/3] Checkpoint Support for Syscall User Dispatch Gregory Price
2023-01-23 3:29 ` [PATCH v5 1/3] ptrace,syscall_user_dispatch: Implement Syscall User Dispatch Suspension Gregory Price
2023-01-23 3:29 ` [PATCH 2/3] fs/proc/array: Add Syscall User Dispatch to proc status Gregory Price
2023-01-23 3:29 ` [PATCH 3/3] ptrace,syscall_user_dispatch: add a getter/setter for sud configuration Gregory Price
2023-01-23 15:41 ` Oleg Nesterov
2023-01-23 18:12 ` Gregory Price [this message]
2023-01-23 19:52 ` Oleg Nesterov
2023-01-24 15:59 ` Gregory Price
2023-01-24 16:43 ` Oleg Nesterov
2023-01-24 16:54 ` Gregory Price
2023-01-24 17:58 ` Andrei Vagin
2023-01-24 21:39 ` Gregory Price
2023-01-24 2:51 ` Andrei Vagin
2023-01-24 3:30 ` Gregory Price
-- strict thread matches above, loose matches on Subject: below --
2023-01-18 20:10 [PATCH v2 0/3] Checkpoint Support for Syscall User Dispatch Gregory Price
2023-01-18 20:10 ` [PATCH 3/3] ptrace,syscall_user_dispatch: add a getter/setter for sud configuration Gregory Price
2023-01-18 23:43 ` kernel test robot
2023-01-19 1:06 ` kernel test robot
2023-01-19 1:16 ` kernel test robot
2023-01-19 2:39 ` kernel test robot
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=Y87OEdDXwZG8pmmE@memverge.com \
--to=gregory.price@memverge.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=ebiederm@xmission.com \
--cc=gourry.memverge@gmail.com \
--cc=krisman@collabora.com \
--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@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=shuah@kernel.org \
--cc=tglx@linutronix.de \
/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.