diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-10-16 19:39:37 +0200 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2013-10-29 18:02:55 +0100 |
commit | 3ab679661721b1ec2aaad99a801870ed59ab1110 (patch) | |
tree | f651a01eb98dd5454d433da9ae35579242a2cb36 /kernel/fork.c | |
parent | uprobes: Change uprobe_copy_process() to dup xol_area (diff) | |
download | linux-3ab679661721b1ec2aaad99a801870ed59ab1110.tar.xz linux-3ab679661721b1ec2aaad99a801870ed59ab1110.zip |
uprobes: Teach uprobe_copy_process() to handle CLONE_VFORK
uprobe_copy_process() does nothing if the child shares ->mm with
the forking process, but there is a special case: CLONE_VFORK.
In this case it would be more correct to do dup_utask() but avoid
dup_xol(). This is not that important, the child should not unwind
its stack too much, this can corrupt the parent's stack, but at
least we need this to allow to ret-probe __vfork() itself.
Note: in theory, it would be better to check task_pt_regs(p)->sp
instead of CLONE_VFORK, we need to dup_utask() if and only if the
child can return from the function called by the parent. But this
needs the arch-dependant helper, and I think that nobody actually
does clone(same_stack, CLONE_VM).
Reported-by: Martin Cermak <mcermak@redhat.com>
Reported-by: David Smith <dsmith@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index d3603b81246b..8531609b6a82 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1489,7 +1489,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, perf_event_fork(p); trace_task_newtask(p, clone_flags); - uprobe_copy_process(p); + uprobe_copy_process(p, clone_flags); return p; |