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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 9 Sep 2011 18:41:22 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Ben Blum <bblum@...rew.cmu.edu>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	fweisbec@...il.com, neilb@...e.de, paul@...lmenage.org,
	paulmck@...ux.vnet.ibm.com
Subject: Re: +
	cgroups-more-safe-tasklist-locking-in-cgroup_attach_proc.patch
	added to -mm tree

On 09/08, Ben Blum wrote:
>
> On Thu, Sep 08, 2011 at 11:31:30PM +0200, Oleg Nesterov wrote:
> > On 09/08, Ben Blum wrote:
> > >
> > > As for the patch below (which is the same as it was last time?):
> >
> > It is the same, yes, I simply copied it from my old email. BTW, it
> > wasn't tested at all, even compiled.
>
> Testing is recommended ;)

Heh, that is why I didn't send the patch "officially". Not to mention
I never used cgroups.

> If you polished this patch off, I'd be happier, since I have a lot else
> on my plate.

Same here ;)

> > Off-topic question... Looking at this code, it seems that
> > attach_task_by_pid(zombie_pid, threadgroup => true) returns 0.
> > single-task-only case fails with -ESRCH in this case. I am not
> > saying this is wrong, just this looks a bit strange (unless I
> > misread the code).
>
> yeah, this is a side-effect of cgroup_attach_proc continuing to iterate
> in case any one of the sub-threads be still alive. you could keep track
> of whether all threads were zombies and return -ESRCH then,

Yes I see. Although PF_EXITING && thread_group_empty() could help.

> but it
> shouldn't matter, since the user-facing behaviour is indistinguishable
> from if the user had sent the command just before the task turned zombie
> but while it was still about to exit.

Not sure. A task can spend a lot of time being zombie. In this case
we return success or -ESRCH depending on threadgroup.

But I agree, this is minor.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ