lkml.org 
[lkml]   [2016]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v1.9 12/14] livepatch: create per-task consistency model
On Fri, 25 Mar 2016, Josh Poimboeuf wrote:

[...]

> diff --git a/kernel/fork.c b/kernel/fork.c
> index d277e83..27b181e 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -76,6 +76,7 @@
> #include <linux/compiler.h>
> #include <linux/sysctl.h>
> #include <linux/kcov.h>
> +#include <linux/livepatch.h>
>
> #include <asm/pgtable.h>
> #include <asm/pgalloc.h>
> @@ -1615,6 +1616,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
> total_forks++;
> spin_unlock(&current->sighand->siglock);
> syscall_tracepoint_update(p);
> + klp_update_task_universe(p);

Shouldn't we copy transition and TIF from the parent? I deal with a race
in kgraft and the solution seems to be this code exactly at this place in
copy_process(). I need to think about it.

[...]

> +static void klp_schedule_work(void)
> +{
> + if (IS_ENABLED(CONFIG_RELIABLE_STACKTRACE))
> + schedule_delayed_work(&klp_work, round_jiffies_relative(HZ));
> +}

As mentioned in my cover letter reply I'd allow to schedule delayed work
even for !CONFIG_RELIABLE_STACKTRACE archs and configurations. There is a
check in klp_try_switch_task() for CONFIG_RELIABLE_STACKTRACE so the
change should be trivial. The patching could be successful even without
reliable stack traces especially in combination with a fake signal and
a syscall boundary migration.

Miroslav

\
 
 \ /
  Last update: 2016-03-31 15:21    [W:1.998 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site