lkml.org 
[lkml]   [2011]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 3.2-rc2 9/30] uprobes: Background page replacement.
* Peter Zijlstra <peterz@infradead.org> [2011-11-25 15:54:46]:

> On Fri, 2011-11-18 at 16:38 +0530, Srikar Dronamraju wrote:
> > +static int read_opcode(struct mm_struct *mm, unsigned long vaddr,
> > + uprobe_opcode_t *opcode)
> > +{
> > + struct page *page;
> > + void *vaddr_new;
> > + int ret;
> > +
> > + ret = get_user_pages(NULL, mm, vaddr, 1, 0, 0, &page, NULL);
> > + if (ret <= 0)
> > + return ret;
> > +
> > + lock_page(page);
> > + vaddr_new = kmap_atomic(page);
> > + vaddr &= ~PAGE_MASK;
>
> BUG_ON(vaddr + uprobe_opcode_sz >= PAGE_SIZE);
>

Okay, will add BUG_ON.



\
 
 \ /
  Last update: 2011-11-26 03:29    [from the cache]
©2003-2011 Jasper Spaans