lkml.org 
[lkml]   [2013]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] uprobes: Change uprobe_copy_process() to dup xol_area
On 10/13, Oleg Nesterov wrote:
>
> Unfortunately, uprobe_copy_process() can not simply do
> __create_xol_area(child, xol_area->vaddr). This could actually work
> but perf_event_mmap() doesn't expect the usage of foreign ->mm. So
> we offload this to task_work_run(), and pass the argument via not
> yet used utask->vaddr.

OK, this patch needs a fix, I'll send v2 in a minute.


> + work = kmalloc(sizeof(*work), GFP_KERNEL);
> + if (!work)
> + return uprobe_warn(t, "dup xol area");
> +
> + utask->vaddr = mm->uprobes_state.xol_area->vaddr;

Yes, currently utask->return_instances && !uprobes_state.xol_area
is not possible.

> + init_task_work(work, dup_xol_work);
> + task_work_add(t, work, true);

But if dup_xol_work() fails and the child does another fork(), it
can hit area == NULL, so we need to check this.

Oleg.



\
 
 \ /
  Last update: 2013-10-18 18:41    [W:0.511 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site