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: <1309165071.6701.4.camel@twins>
Date:	Mon, 27 Jun 2011 10:57:51 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
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>,
	Andi Kleen <andi@...stfloor.org>,
	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>,
	LKML <linux-kernel@...r.kernel.org>,
	Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
	Roland McGrath <roland@...k.frob.com>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v4 3.0-rc2-tip 7/22]  7: uprobes: mmap and fork hooks.

On Mon, 2011-06-27 at 12:15 +0530, Srikar Dronamraju wrote:

> > > 	mutex_lock(&mapping->i_mmap_mutex);
> > > 	add_to_temp_list(vma, inode, &tmp_list);
> > > 	list_for_each_entry_safe(uprobe, u, &tmp_list, pending_list) {
> > > 		loff_t vaddr;
> > > 
> > > 		list_del(&uprobe->pending_list);
> > > 		if (ret)
> > > 			continue;
> > > 
> > > 		vaddr = vma->vm_start + uprobe->offset;
> > > 		vaddr -= vma->vm_pgoff << PAGE_SHIFT;
> > > 		ret = install_breakpoint(mm, uprobe, vaddr);
> > 
> > Right, so this is the problem, you cannot do allocations under
> > i_mmap_mutex, however I think you can under i_mutex.
> 
> I didnt know that we cannot do allocations under i_mmap_mutex.
> Why is this? 

Because we try to take i_mmap_mutex during reclaim, trying to unmap
pages. So suppose we do an allocation while holding i_mmap_mutex, find
there's no free memory, try and unmap a page in order to free it, and
we're stuck.

> I cant take i_mutex, because we would have already held
> down_write(mmap_sem) here. 

Right. So can we add a lock in the uprobe? All we need is per uprobe
serialization, right?
--
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