Messages in this thread | | | Date | Fri, 18 Oct 2013 17:49:34 +0200 | From | Oleg Nesterov <> | Subject | Re: [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.
| |