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] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 16 Jan 2012 09:34:42 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Arnaldo Carvalho de Melo <acme@...hat.com>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Oleg Nesterov <oleg@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Linux-mm <linux-mm@...ck.org>, Andi Kleen <andi@...stfloor.org>,
	Christoph Hellwig <hch@...radead.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Roland McGrath <roland@...k.frob.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Arnaldo Carvalho de Melo <acme@...radead.org>,
	Anton Arapov <anton@...hat.com>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [PATCH v9 3.2 0/9] Uprobes patchset with perf probe support


* Srikar Dronamraju <srikar@...ux.vnet.ibm.com> wrote:

> This patchset implements Uprobes which enables you to 
> dynamically probe any routine in a user space application and 
> collect information non-disruptively.

Did all review feedback get addressed in your latest tree?

If yes then it would be nice to hear the opinion of Andrew about 
this bit:

>  mm/mmap.c                               |   33 +-

The relevant portion of the patch is:

> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -30,6 +30,7 @@
>  #include <linux/perf_event.h>
>  #include <linux/audit.h>
>  #include <linux/khugepaged.h>
> +#include <linux/uprobes.h>
>  
>  #include <asm/uaccess.h>
>  #include <asm/cacheflush.h>
> @@ -616,6 +617,13 @@ again:			remove_next = 1 + (end > next->vm_end);
>  	if (mapping)
>  		mutex_unlock(&mapping->i_mmap_mutex);
>  
> +	if (root) {
> +		mmap_uprobe(vma);
> +
> +		if (adjust_next)
> +			mmap_uprobe(next);
> +	}
> +
>  	if (remove_next) {
>  		if (file) {
>  			fput(file);
> @@ -637,6 +645,8 @@ again:			remove_next = 1 + (end > next->vm_end);
>  			goto again;
>  		}
>  	}
> +	if (insert && file)
> +		mmap_uprobe(insert);
>  
>  	validate_mm(mm);
>  
> @@ -1329,6 +1339,11 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
>  			mm->locked_vm += (len >> PAGE_SHIFT);
>  	} else if ((flags & MAP_POPULATE) && !(flags & MAP_NONBLOCK))
>  		make_pages_present(addr, addr + len);
> +
> +	if (file && mmap_uprobe(vma))
> +		/* matching probes but cannot insert */
> +		goto unmap_and_free_vma;
> +
>  	return addr;
>  
>  unmap_and_free_vma:
> @@ -2305,6 +2320,10 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
>  	if ((vma->vm_flags & VM_ACCOUNT) &&
>  	     security_vm_enough_memory_mm(mm, vma_pages(vma)))
>  		return -ENOMEM;
> +
> +	if (vma->vm_file && mmap_uprobe(vma))
> +		return -EINVAL;
> +
>  	vma_link(mm, vma, prev, rb_link, rb_parent);
>  	return 0;
>  }
> @@ -2356,6 +2375,10 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
>  			new_vma->vm_pgoff = pgoff;
>  			if (new_vma->vm_file) {
>  				get_file(new_vma->vm_file);
> +
> +				if (mmap_uprobe(new_vma))
> +					goto out_free_mempol;
> +
>  				if (vma->vm_flags & VM_EXECUTABLE)
>  					added_exe_file_vma(mm);
>  			}

it's named mmap_uprobe(), which makes it rather single-purpose. 
The uprobes code wants to track vma life-time so that it can 
manage uprobes breakpoints installed here, correct?

We already have some other vma tracking goodies in perf itself 
(see perf_event_mmap() et al) - would it make sense to merge the 
two vma instrumentation facilities and not burden mm/ with two 
separate sets of callbacks?

If all such issues are resolved then i guess we could queue up 
uprobes in -tip, conditional on it remaining sufficiently 
regression-, problem- and NAK-free.

Also, it would be nice to hear Arnaldo's opinion about the 
tools/perf/ bits.

Thanks,

	Ingo
--
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