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: <6af63d84-b948-edd2-4fa1-a2e639fa716f@gmail.com>
Date:   Wed, 7 Aug 2019 17:33:29 +0100
From:   Dmitry Safonov <0x7f454c46@...il.com>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Adrian Reber <areber@...hat.com>,
        Christian Brauner <christian@...uner.io>,
        Eric Biederman <ebiederm@...ssion.com>,
        Pavel Emelianov <xemul@...tuozzo.com>,
        Jann Horn <jannh@...gle.com>, linux-kernel@...r.kernel.org,
        Andrei Vagin <avagin@...il.com>,
        Mike Rapoport <rppt@...ux.ibm.com>,
        Radostin Stoyanov <rstoyanov1@...il.com>
Subject: Re: [PATCH v3 1/2] fork: extend clone3() to support CLONE_SET_TID

On 8/7/19 5:21 PM, Oleg Nesterov wrote:
> On 08/07, Dmitry Safonov wrote:
[..]
>> What if the size is lesser than offsetof(struct clone_args, stack_size)?
>> Probably, there should be still a check that it's not lesser than what's
>> the required minimum..
> 
> Not sure I understand... I mean, this doesn't differ from the case when
> size == sizeof(clone_args) but uargs->stack == NULL ?

I might be mistaken and I confess that I don't fully understand the
code, but wouldn't it mystically fail in copy_thread_tls() with -ENOMEM
instead of -EINVAL?
Maybe not a huge difference, but..

>> Also note, that (kargs) and (args) are a bit different beasts in this
>> context..
>> kargs lies on the stack and might want to be with zero-initializer
>> :	struct kernel_clone_args kargs = {};
> 
> I don't think so. Lets consider this patch which adds the new set_tid
> into clone_args and kernel_clone_args. copy_clone_args_from_user() does
> 
> 	*kargs = (struct kernel_clone_args){
> 		.flags		= args.flags,
> 		.pidfd		= u64_to_user_ptr(args.pidfd),
> 		.child_tid	= u64_to_user_ptr(args.child_tid),
> 		.parent_tid	= u64_to_user_ptr(args.parent_tid),
> 		.exit_signal	= args.exit_signal,
> 		.stack		= args.stack,
> 		.stack_size	= args.stack_size,
> 		.tls		= args.tls,
> 	};
> 
> so this patch should simply add
> 
> 		.set_tid	= args.set_tid;
> 
> at the end. No?
Agree, this may be better.

-- 
          Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ