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: <20191114155052.GA13149@redhat.com>
Date:   Thu, 14 Nov 2019 16:50:52 +0100
From:   Oleg Nesterov <oleg@...hat.com>
To:     Adrian Reber <areber@...hat.com>
Cc:     Christian Brauner <christian.brauner@...ntu.com>,
        Eric Biederman <ebiederm@...ssion.com>,
        Pavel Emelyanov <ovzxemul@...il.com>,
        Jann Horn <jannh@...gle.com>,
        Dmitry Safonov <0x7f454c46@...il.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        linux-kernel@...r.kernel.org, Andrei Vagin <avagin@...il.com>,
        Mike Rapoport <rppt@...ux.ibm.com>,
        Radostin Stoyanov <rstoyanov1@...il.com>
Subject: Re: [PATCH v10 1/2] fork: extend clone3() to support setting a PID

On 11/14, Adrian Reber wrote:
>
> @@ -2600,6 +2602,15 @@ noinline static int copy_clone_args_from_user(struct kernel_clone_args *kargs,
>  	if (err)
>  		return err;
>
> +	if (unlikely(args.set_tid_size > MAX_PID_NS_LEVEL))
> +		return -EINVAL;

so we need this to because copy_from_user() below writes into the
set_tid[MAX_PID_NS_LEVEL] on the caller's stack, then later alloc_pid()
does another "correct" check... We could simply shift that check here,
but probably this would be less clear, so I won't argue.

> @@ -2617,8 +2628,16 @@ noinline static int copy_clone_args_from_user(struct kernel_clone_args *kargs,
>  		.stack		= args.stack,
>  		.stack_size	= args.stack_size,
>  		.tls		= args.tls,
> +		.set_tid_size	= args.set_tid_size,
>  	};
...
> +	kargs->set_tid = kset_tid;

this looks a bit strange, you could simply do

		.set_tid_size   = args.set_tid_size,
		.set_tid	= kset_tid,

but this is really minor.

Looks good to me,

Reviewed-by: Oleg Nesterov <oleg@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ