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]
Date:	Thu, 16 Jun 2011 15:24:12 +0530
From:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
	Linux-mm <linux-mm@...ck.org>,
	Arnaldo Carvalho de Melo <acme@...radead.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Hugh Dickins <hughd@...gle.com>,
	Christoph Hellwig <hch@...radead.org>,
	Jonathan Corbet <corbet@....net>,
	Thomas Gleixner <tglx@...utronix.de>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Oleg Nesterov <oleg@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
	Roland McGrath <roland@...k.frob.com>,
	Andi Kleen <andi@...stfloor.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 3.0-rc2-tip 4/22]  4: Uprobes: register/unregister
 probes.

* Peter Zijlstra <peterz@...radead.org> [2011-06-16 11:46:22]:

> On Thu, 2011-06-16 at 09:41 +0530, Srikar Dronamraju wrote:
> > * Peter Zijlstra <peterz@...radead.org> [2011-06-15 19:41:59]:
> > 
> > > On Tue, 2011-06-07 at 18:29 +0530, Srikar Dronamraju wrote:
> > > > 1. Use mm->owner and walk thro the thread_group of mm->owner, siblings
> > > > of mm->owner, siblings of parent of mm->owner.  This should be
> > > > good list to traverse. Not sure if this is an exhaustive
> > > > enough list that all tasks that have a mm set to this mm_struct are
> > > > walked through. 
> > > 
> > > As per copy_process():
> > > 
> > > 	/*
> > > 	 * Thread groups must share signals as well, and detached threads
> > > 	 * can only be started up within the thread group.
> > > 	 */
> > > 	if ((clone_flags & CLONE_THREAD) && !(clone_flags & CLONE_SIGHAND))
> > > 		return ERR_PTR(-EINVAL);
> > > 
> > > 	/*
> > > 	 * Shared signal handlers imply shared VM. By way of the above,
> > > 	 * thread groups also imply shared VM. Blocking this case allows
> > > 	 * for various simplifications in other code.
> > > 	 */
> > > 	if ((clone_flags & CLONE_SIGHAND) && !(clone_flags & CLONE_VM))
> > > 		return ERR_PTR(-EINVAL);
> > > 
> > > CLONE_THREAD implies CLONE_VM, but not the other way around, we
> > > therefore would be able to CLONE_VM and not be part of the primary
> > > owner's thread group.
> > > 
> > > This is of course all terribly sad..
> > 
> > Agree, 
> > 
> > If clone(CLONE_VM) were to be done by a thread_group leader, we can walk
> > thro the siblings of parent of mm->owner.
> > 
> > However if clone(CLONE_VM) were to be done by non thread_group_leader
> > thread, then we dont even seem to add it to the init_task. i.e I dont
> > think we can refer to such a thread even when we walk thro
> > do_each_thread(g,t) { .. } while_each_thread(g,t);
> > 
> > right?
> 
> No, we initialize p->group_leader = p; and only change that for
> CLONE_THREAD, so a clone without CLONE_THREAD always results in a new
> thread group leader, which are always added to the init_task list.
> 

Ahh .. I missed the p->group_leader = p thing.

In which case, shouldnt traversing all the tasks of all siblings of 
parent of mm->owner should provide us all the the tasks that have linked
to mm. Right?

Agree that we can bother about this a little later.

-- 
Thanks and Regards
Srikar
--
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