This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH v3 2.6.39-rc1-tip 6/26] 6: Uprobes: register/unregister probes.
- From: Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
- To: Stephen Wilson <wilsons at start dot ca>
- Cc: Peter Zijlstra <peterz at infradead dot org>, Ingo Molnar <mingo at elte dot hu>, Steven Rostedt <rostedt at goodmis dot org>, Linux-mm <linux-mm at kvack dot org>, Arnaldo Carvalho de Melo <acme at infradead dot org>, Linus Torvalds <torvalds at linux-foundation dot org>, Jonathan Corbet <corbet at lwn dot net>, Christoph Hellwig <hch at infradead dot org>, Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>, Thomas Gleixner <tglx at linutronix dot de>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Oleg Nesterov <oleg at redhat dot com>, Andrew Morton <akpm at linux-foundation dot org>, SystemTap <systemtap at sources dot redhat dot com>, Jim Keniston <jkenisto at linux dot vnet dot ibm dot com>, Roland McGrath <roland at hack dot frob dot com>, Andi Kleen <andi at firstfloor dot org>, LKML <linux-kernel at vger dot kernel dot org>
- Date: Sat, 2 Apr 2011 06:23:53 +0530
- Subject: Re: [PATCH v3 2.6.39-rc1-tip 6/26] 6: Uprobes: register/unregister probes.
- References: <20110401143223.15455.19844.sendpatchset@localhost6.localdomain6> <20110401143338.15455.98645.sendpatchset@localhost6.localdomain6> <20110402002633.GA13277@fibrous.localdomain>
- Reply-to: Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
> > +
> > + mm = vma->vm_mm;
> > + if (!valid_vma(vma)) {
> > + mmput(mm);
> > + continue;
> > + }
> > +
> > + vaddr = vma->vm_start + offset;
> > + vaddr -= vma->vm_pgoff << PAGE_SHIFT;
>
> What happens here when someone passes an offset that is out of bounds
> for the vma? Looks like we could oops when the kernel tries to set a
> breakpoint. Perhaps check wrt ->vm_end?
>
If the offset is wrong, install_uprobe will fail, since
grab_cache_page() should not be able to find that page for us.
And hence we return gracefully.
I will surely test this case and I am happy to add a check for
vm_end.
--
Thanks and Regards
Srikar