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] [day] [month] [year] [list]
Date:   Fri, 12 Mar 2021 10:51:29 -0600
From:   Jim Newsome <jnewsome@...project.org>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        "Eric W . Biederman" <ebiederm@...ssion.com>,
        Christian Brauner <christian@...uner.io>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] do_wait: make PIDTYPE_PID case O(1) instead of O(n)


On 3/12/21 10:41, Oleg Nesterov wrote:
> On 03/11, Jim Newsome wrote:
>> +
>> +	if (target && is_effectively_child(wo, ptrace, target)) {
>> +		retval = wait_consider_task(wo, ptrace, target);
> No, this is not right... You need to check target->ptrace != 0.

Shoot; got lost in the shuffle. Sorry about that and thanks for catching!

> I know that Eric suggests to not use thread_group_leader() and I won't argue
> even if I don't really agree.
>
> Up to you, but to me something like
>
> 	do_wait_pid()
> 	{
> 		target = pid_task(wo->wo_pid, PIDTYPE_PID);
>
> 		if (!target)
> 			return 0;
>
> 		if (thread_group_leader(target) &&
> 		    is_effectively_child(wo, 0, target) {
> 			...			
> 		}
>
> 		if (target->ptrace &&
> 		    is_effectively_child(wo, 1, target) {
> 			...
> 		}
>
> 		return 0;
>
> 	}
>
> looks more simple/clean.

I like that a little better too. I'll go this way since Eric seemed Ok
with either way.

If we do that then it might make sense to move the `thread_group_leader`
filter into `is_effectively_child`, but maybe that obscures what the
latter is doing too much. It'd at least have to be renamed, and I'm not
sure of a clear name that'd capture exactly what it's doing. Maybe
`is_valid_waitee`?

If I don't hear anything I'll just go with how you've already proposed.

v5 coming in a bit. I'll drop your (Oleg's) reviewed-by since it's
changed substantially since then.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ