Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2018-01-25 Thread Peter Zijlstra
On Thu, Jan 25, 2018 at 01:13:21PM +0100, Petr Mladek wrote: > > What I was getting at, the klp stuff is the very first thing we run when > > we schedule the idle task, but its placed at the very end of the > > function. This is confusing. > > I see. > > > > The above still doesn't help with

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2018-01-25 Thread Peter Zijlstra
On Thu, Jan 25, 2018 at 01:13:21PM +0100, Petr Mladek wrote: > > What I was getting at, the klp stuff is the very first thing we run when > > we schedule the idle task, but its placed at the very end of the > > function. This is confusing. > > I see. > > > > The above still doesn't help with

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2018-01-25 Thread Petr Mladek
On Thu 2018-01-25 11:38:55, Peter Zijlstra wrote: > On Thu, Jan 25, 2018 at 11:24:14AM +0100, Petr Mladek wrote: > > On Thu 2018-01-25 10:04:44, Peter Zijlstra wrote: > > > On Mon, Feb 13, 2017 at 07:42:40PM -0600, Josh Poimboeuf wrote: > > > > diff --git a/kernel/sched/idle.c

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2018-01-25 Thread Petr Mladek
On Thu 2018-01-25 11:38:55, Peter Zijlstra wrote: > On Thu, Jan 25, 2018 at 11:24:14AM +0100, Petr Mladek wrote: > > On Thu 2018-01-25 10:04:44, Peter Zijlstra wrote: > > > On Mon, Feb 13, 2017 at 07:42:40PM -0600, Josh Poimboeuf wrote: > > > > diff --git a/kernel/sched/idle.c

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2018-01-25 Thread Peter Zijlstra
On Thu, Jan 25, 2018 at 11:24:14AM +0100, Petr Mladek wrote: > On Thu 2018-01-25 10:04:44, Peter Zijlstra wrote: > > On Mon, Feb 13, 2017 at 07:42:40PM -0600, Josh Poimboeuf wrote: > > > diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c > > > index 6a4bae0..a8b3f1a 100644 > > > ---

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2018-01-25 Thread Peter Zijlstra
On Thu, Jan 25, 2018 at 11:24:14AM +0100, Petr Mladek wrote: > On Thu 2018-01-25 10:04:44, Peter Zijlstra wrote: > > On Mon, Feb 13, 2017 at 07:42:40PM -0600, Josh Poimboeuf wrote: > > > diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c > > > index 6a4bae0..a8b3f1a 100644 > > > ---

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2018-01-25 Thread Petr Mladek
On Thu 2018-01-25 10:04:44, Peter Zijlstra wrote: > On Mon, Feb 13, 2017 at 07:42:40PM -0600, Josh Poimboeuf wrote: > > diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c > > index 6a4bae0..a8b3f1a 100644 > > --- a/kernel/sched/idle.c > > +++ b/kernel/sched/idle.c > > @@ -9,6 +9,7 @@ > >

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2018-01-25 Thread Petr Mladek
On Thu 2018-01-25 10:04:44, Peter Zijlstra wrote: > On Mon, Feb 13, 2017 at 07:42:40PM -0600, Josh Poimboeuf wrote: > > diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c > > index 6a4bae0..a8b3f1a 100644 > > --- a/kernel/sched/idle.c > > +++ b/kernel/sched/idle.c > > @@ -9,6 +9,7 @@ > >

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2018-01-25 Thread Peter Zijlstra
On Mon, Feb 13, 2017 at 07:42:40PM -0600, Josh Poimboeuf wrote: > diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c > index 6a4bae0..a8b3f1a 100644 > --- a/kernel/sched/idle.c > +++ b/kernel/sched/idle.c > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include > > #include >

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2018-01-25 Thread Peter Zijlstra
On Mon, Feb 13, 2017 at 07:42:40PM -0600, Josh Poimboeuf wrote: > diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c > index 6a4bae0..a8b3f1a 100644 > --- a/kernel/sched/idle.c > +++ b/kernel/sched/idle.c > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include > > #include >

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-04-11 Thread Petr Mladek
On Mon 2017-02-13 19:42:40, Josh Poimboeuf wrote: > Change livepatch to use a basic per-task consistency model. This is the > foundation which will eventually enable us to patch those ~10% of > security patches which change function or data semantics. This is the > biggest remaining piece needed

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-04-11 Thread Petr Mladek
On Mon 2017-02-13 19:42:40, Josh Poimboeuf wrote: > Change livepatch to use a basic per-task consistency model. This is the > foundation which will eventually enable us to patch those ~10% of > security patches which change function or data semantics. This is the > biggest remaining piece needed

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-03-07 Thread Miroslav Benes
On Mon, 13 Feb 2017, Josh Poimboeuf wrote: > Change livepatch to use a basic per-task consistency model. This is the > foundation which will eventually enable us to patch those ~10% of > security patches which change function or data semantics. This is the > biggest remaining piece needed to

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-03-07 Thread Miroslav Benes
On Mon, 13 Feb 2017, Josh Poimboeuf wrote: > Change livepatch to use a basic per-task consistency model. This is the > foundation which will eventually enable us to patch those ~10% of > security patches which change function or data semantics. This is the > biggest remaining piece needed to

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-22 Thread Miroslav Benes
On Tue, 21 Feb 2017, Josh Poimboeuf wrote: > On Fri, Feb 17, 2017 at 09:51:29AM +0100, Miroslav Benes wrote: > > On Thu, 16 Feb 2017, Josh Poimboeuf wrote: > > > What do you think about the following? I tried to put the logic in > > > klp_complete_transition(), so the module_put()'s would be in

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-22 Thread Miroslav Benes
On Tue, 21 Feb 2017, Josh Poimboeuf wrote: > On Fri, Feb 17, 2017 at 09:51:29AM +0100, Miroslav Benes wrote: > > On Thu, 16 Feb 2017, Josh Poimboeuf wrote: > > > What do you think about the following? I tried to put the logic in > > > klp_complete_transition(), so the module_put()'s would be in

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-21 Thread Josh Poimboeuf
On Fri, Feb 17, 2017 at 09:51:29AM +0100, Miroslav Benes wrote: > On Thu, 16 Feb 2017, Josh Poimboeuf wrote: > > What do you think about the following? I tried to put the logic in > > klp_complete_transition(), so the module_put()'s would be in one place. > > But it was too messy, so I put it in

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-21 Thread Josh Poimboeuf
On Fri, Feb 17, 2017 at 09:51:29AM +0100, Miroslav Benes wrote: > On Thu, 16 Feb 2017, Josh Poimboeuf wrote: > > What do you think about the following? I tried to put the logic in > > klp_complete_transition(), so the module_put()'s would be in one place. > > But it was too messy, so I put it in

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-17 Thread Miroslav Benes
On Thu, 16 Feb 2017, Josh Poimboeuf wrote: > On Thu, Feb 16, 2017 at 03:33:26PM +0100, Miroslav Benes wrote: > > > > > @@ -347,22 +356,36 @@ static int __klp_enable_patch(struct klp_patch > > > *patch) > > > > > > pr_notice("enabling patch '%s'\n", patch->mod->name); > > > > > > +

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-17 Thread Miroslav Benes
On Thu, 16 Feb 2017, Josh Poimboeuf wrote: > On Thu, Feb 16, 2017 at 03:33:26PM +0100, Miroslav Benes wrote: > > > > > @@ -347,22 +356,36 @@ static int __klp_enable_patch(struct klp_patch > > > *patch) > > > > > > pr_notice("enabling patch '%s'\n", patch->mod->name); > > > > > > +

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-16 Thread Josh Poimboeuf
On Thu, Feb 16, 2017 at 03:33:26PM +0100, Miroslav Benes wrote: > > > @@ -347,22 +356,36 @@ static int __klp_enable_patch(struct klp_patch *patch) > > > > pr_notice("enabling patch '%s'\n", patch->mod->name); > > > > + klp_init_transition(patch, KLP_PATCHED); > > + > > + /* > > +*

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-16 Thread Josh Poimboeuf
On Thu, Feb 16, 2017 at 03:33:26PM +0100, Miroslav Benes wrote: > > > @@ -347,22 +356,36 @@ static int __klp_enable_patch(struct klp_patch *patch) > > > > pr_notice("enabling patch '%s'\n", patch->mod->name); > > > > + klp_init_transition(patch, KLP_PATCHED); > > + > > + /* > > +*

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-16 Thread Miroslav Benes
> @@ -347,22 +356,36 @@ static int __klp_enable_patch(struct klp_patch *patch) > > pr_notice("enabling patch '%s'\n", patch->mod->name); > > + klp_init_transition(patch, KLP_PATCHED); > + > + /* > + * Enforce the order of the func->transition writes in > + *

Re: [PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-16 Thread Miroslav Benes
> @@ -347,22 +356,36 @@ static int __klp_enable_patch(struct klp_patch *patch) > > pr_notice("enabling patch '%s'\n", patch->mod->name); > > + klp_init_transition(patch, KLP_PATCHED); > + > + /* > + * Enforce the order of the func->transition writes in > + *

[PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-13 Thread Josh Poimboeuf
Change livepatch to use a basic per-task consistency model. This is the foundation which will eventually enable us to patch those ~10% of security patches which change function or data semantics. This is the biggest remaining piece needed to make livepatch more generally useful. This code stems

[PATCH v5 13/15] livepatch: change to a per-task consistency model

2017-02-13 Thread Josh Poimboeuf
Change livepatch to use a basic per-task consistency model. This is the foundation which will eventually enable us to patch those ~10% of security patches which change function or data semantics. This is the biggest remaining piece needed to make livepatch more generally useful. This code stems