Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-04-04 Thread Petr Mladek
On Wed 2018-03-14 14:44:36, Josh Poimboeuf wrote: > On Wed, Mar 14, 2018 at 03:27:02PM -0400, Joe Lawrence wrote: > > On Tue, Mar 13, 2018 at 04:54:47PM +0100, Petr Mladek wrote: > > > The existing API allows to pass a sample data to initialize the shadow > > > data. It works well when the data

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-04-04 Thread Petr Mladek
On Wed 2018-03-14 14:44:36, Josh Poimboeuf wrote: > On Wed, Mar 14, 2018 at 03:27:02PM -0400, Joe Lawrence wrote: > > On Tue, Mar 13, 2018 at 04:54:47PM +0100, Petr Mladek wrote: > > > The existing API allows to pass a sample data to initialize the shadow > > > data. It works well when the data

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-21 Thread Miroslav Benes
> @@ -186,10 +198,13 @@ static void *__klp_shadow_get_or_alloc(void *obj, > unsigned long id, void *data, > * Return: the shadow variable data element, NULL on duplicate or > * failure. > */ > -void *klp_shadow_alloc(void *obj, unsigned long id, void *data, > -size_t

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-21 Thread Miroslav Benes
> @@ -186,10 +198,13 @@ static void *__klp_shadow_get_or_alloc(void *obj, > unsigned long id, void *data, > * Return: the shadow variable data element, NULL on duplicate or > * failure. > */ > -void *klp_shadow_alloc(void *obj, unsigned long id, void *data, > -size_t

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-14 Thread Josh Poimboeuf
On Wed, Mar 14, 2018 at 03:43:01PM -0400, Joe Lawrence wrote: > >> @@ -150,6 +145,23 @@ static void *__klp_shadow_get_or_alloc(void *obj, > >> unsigned long id, void *data, > >>goto exists; > >>} > >> > >> + new_shadow->obj = obj; > >> + new_shadow->id = id; > >> + > >> + if

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-14 Thread Josh Poimboeuf
On Wed, Mar 14, 2018 at 03:43:01PM -0400, Joe Lawrence wrote: > >> @@ -150,6 +145,23 @@ static void *__klp_shadow_get_or_alloc(void *obj, > >> unsigned long id, void *data, > >>goto exists; > >>} > >> > >> + new_shadow->obj = obj; > >> + new_shadow->id = id; > >> + > >> + if

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-14 Thread Josh Poimboeuf
On Wed, Mar 14, 2018 at 03:27:02PM -0400, Joe Lawrence wrote: > On Tue, Mar 13, 2018 at 04:54:47PM +0100, Petr Mladek wrote: > > The existing API allows to pass a sample data to initialize the shadow > > data. It works well when the data are position independent. But it fails > > miserably when we

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-14 Thread Josh Poimboeuf
On Wed, Mar 14, 2018 at 03:27:02PM -0400, Joe Lawrence wrote: > On Tue, Mar 13, 2018 at 04:54:47PM +0100, Petr Mladek wrote: > > The existing API allows to pass a sample data to initialize the shadow > > data. It works well when the data are position independent. But it fails > > miserably when we

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-14 Thread Joe Lawrence
On 03/14/2018 03:28 PM, Josh Poimboeuf wrote: > On Tue, Mar 13, 2018 at 04:54:47PM +0100, Petr Mladek wrote: > >> diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h >> index 4754f01c1abb..fc7c64ce0992 100644 >> --- a/include/linux/livepatch.h >> +++ b/include/linux/livepatch.h >>

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-14 Thread Joe Lawrence
On 03/14/2018 03:28 PM, Josh Poimboeuf wrote: > On Tue, Mar 13, 2018 at 04:54:47PM +0100, Petr Mladek wrote: > >> diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h >> index 4754f01c1abb..fc7c64ce0992 100644 >> --- a/include/linux/livepatch.h >> +++ b/include/linux/livepatch.h >>

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-14 Thread Josh Poimboeuf
On Tue, Mar 13, 2018 at 04:54:47PM +0100, Petr Mladek wrote: > The existing API allows to pass a sample data to initialize the shadow > data. It works well when the data are position independent. But it fails > miserably when we need to set a pointer to the shadow structure itself. > >

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-14 Thread Josh Poimboeuf
On Tue, Mar 13, 2018 at 04:54:47PM +0100, Petr Mladek wrote: > The existing API allows to pass a sample data to initialize the shadow > data. It works well when the data are position independent. But it fails > miserably when we need to set a pointer to the shadow structure itself. > >

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-14 Thread Joe Lawrence
On Tue, Mar 13, 2018 at 04:54:47PM +0100, Petr Mladek wrote: > The existing API allows to pass a sample data to initialize the shadow > data. It works well when the data are position independent. But it fails > miserably when we need to set a pointer to the shadow structure itself. > >

Re: [PATCH 1/2] livepatch: Initialize shadow variables by init function safely

2018-03-14 Thread Joe Lawrence
On Tue, Mar 13, 2018 at 04:54:47PM +0100, Petr Mladek wrote: > The existing API allows to pass a sample data to initialize the shadow > data. It works well when the data are position independent. But it fails > miserably when we need to set a pointer to the shadow structure itself. > >