Re: [PATCH 2/2] uprobes/core: Handle breakpoint and singlestepexception.

From: Ingo Molnar
Date: Tue Mar 13 2012 - 11:35:58 EST



* Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx> wrote:

> diff --git a/kernel/fork.c b/kernel/fork.c
> index 26a7a67..36508b9 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -67,6 +67,7 @@
> #include <linux/oom.h>
> #include <linux/khugepaged.h>
> #include <linux/signalfd.h>
> +#include <linux/uprobes.h>
>
> #include <asm/pgtable.h>
> #include <asm/pgalloc.h>
> @@ -731,6 +732,8 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
> exit_pi_state_list(tsk);
> #endif
>
> + uprobe_free_utask(tsk);
> +
> /* Get rid of any cached register state */
> deactivate_mm(tsk, mm);
>
> @@ -1322,6 +1325,10 @@ static struct task_struct *copy_process(unsigned long clone_flags,
> INIT_LIST_HEAD(&p->pi_state_list);
> p->pi_state_cache = NULL;
> #endif
> +#ifdef CONFIG_UPROBES
> + p->utask = NULL;
> + p->uprobe_srcu_id = -1;
> +#endif
> /*
> * sigaltstack should be cleared when sharing the same VM
> */

Hm, I suspect by looking at the first two hunks you can guess
how the third hunk should be done more cleanly?

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/