lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y87OEdDXwZG8pmmE@memverge.com>
Date:   Mon, 23 Jan 2023 13:12:33 -0500
From:   Gregory Price <gregory.price@...verge.com>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Gregory Price <gourry.memverge@...il.com>,
        linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-kselftest@...r.kernel.org,
        krisman@...labora.com, tglx@...utronix.de, luto@...nel.org,
        peterz@...radead.org, ebiederm@...ssion.com,
        akpm@...ux-foundation.org, adobriyan@...il.com, corbet@....net,
        shuah@...nel.org
Subject: Re: [PATCH 3/3] ptrace,syscall_user_dispatch: add a getter/setter
 for sud configuration

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ