Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-30 Thread Miroslav Benes
On Fri, 30 Jun 2017, Josh Poimboeuf wrote: > On Mon, Jun 19, 2017 at 06:56:37PM +0200, Miroslav Benes wrote: > > > > > > > I often wonder whether it's really a good idea to even allow the > > > > > unloading of patch modules at all. It adds complexity to the > > > > > livepatch > > > > > code.

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-30 Thread Josh Poimboeuf
On Mon, Jun 19, 2017 at 06:56:37PM +0200, Miroslav Benes wrote: > > > > > I often wonder whether it's really a good idea to even allow the > > > > unloading of patch modules at all. It adds complexity to the livepatch > > > > code. Is it worth it? I don't have an answer but I'd be interested in

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-19 Thread Miroslav Benes
> > > I often wonder whether it's really a good idea to even allow the > > > unloading of patch modules at all. It adds complexity to the livepatch > > > code. Is it worth it? I don't have an answer but I'd be interested in > > > other people's opinion. > > > > I could imagine a situation when

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-19 Thread Miroslav Benes
> Good catch. Let me add a disclaimer here and state that this example is > definitely contrived as I was trying to minimize its size. Applying > shadow variables to a more real life use case would drag in a bunch of > "changed" function dependencies. I didn't want to work around those > with a

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-15 Thread Josh Poimboeuf
rnel.org, > > linux-kernel@vger.kernel.org, Jessica Yu , Jiri Kosina > > , Miroslav Benes > > Subject: Re: [PATCH 3/3] livepatch: add shadow variable sample program > > User-Agent: Mutt/1.6.0.1 (2016-04-01) > > > > On Thu, Jun 15, 2017 at 12:59:43PM +0200, Petr Mlade

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-15 Thread Josh Poimboeuf
On Thu, Jun 15, 2017 at 12:59:43PM +0200, Petr Mladek wrote: > On Wed 2017-06-14 09:57:56, Josh Poimboeuf wrote: > > On Wed, Jun 14, 2017 at 04:21:02PM +0200, Petr Mladek wrote: > > > But it is racy in general. The question is if the API > > > could help here. A possibility might be to allow to > >

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-15 Thread Petr Mladek
On Wed 2017-06-14 09:57:56, Josh Poimboeuf wrote: > On Wed, Jun 14, 2017 at 04:21:02PM +0200, Petr Mladek wrote: > > But it is racy in general. The question is if the API > > could help here. A possibility might be to allow to > > define a callback function that would create the shadow > > structur

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-14 Thread Joe Lawrence
On 06/14/2017 10:21 AM, Petr Mladek wrote: > On Thu 2017-06-01 14:25:26, Joe Lawrence wrote: >> Modify the sample livepatch to demonstrate the shadow variable API. >> >> Signed-off-by: Joe Lawrence >> --- >> samples/livepatch/livepatch-sample.c | 39 >> +++- >> 1

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-14 Thread Josh Poimboeuf
On Wed, Jun 14, 2017 at 04:21:02PM +0200, Petr Mladek wrote: > On Thu 2017-06-01 14:25:26, Joe Lawrence wrote: > > Modify the sample livepatch to demonstrate the shadow variable API. > > > > Signed-off-by: Joe Lawrence > > --- > > samples/livepatch/livepatch-sample.c | 39 > > ++

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-14 Thread Petr Mladek
On Thu 2017-06-01 14:25:26, Joe Lawrence wrote: > Modify the sample livepatch to demonstrate the shadow variable API. > > Signed-off-by: Joe Lawrence > --- > samples/livepatch/livepatch-sample.c | 39 > +++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-14 Thread Miroslav Benes
> I'm not familiar with klp-convert, so I'll assume that will be handled > as its own patch(set). Correct. Miroslav

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-13 Thread Joe Lawrence
On 06/13/2017 07:00 AM, Miroslav Benes wrote: > On Thu, 1 Jun 2017, Joe Lawrence wrote: > >> Modify the sample livepatch to demonstrate the shadow variable API. >> >> Signed-off-by: Joe Lawrence >> --- >> samples/livepatch/livepatch-sample.c | 39 >> +++- >> 1 fi

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-13 Thread Miroslav Benes
On Thu, 1 Jun 2017, Joe Lawrence wrote: > Modify the sample livepatch to demonstrate the shadow variable API. > > Signed-off-by: Joe Lawrence > --- > samples/livepatch/livepatch-sample.c | 39 > +++- > 1 file changed, 38 insertions(+), 1 deletion(-) Would it ma

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-09 Thread Joe Lawrence
On 06/09/2017 02:38 PM, Josh Poimboeuf wrote: > On Thu, Jun 01, 2017 at 02:25:26PM -0400, Joe Lawrence wrote: >> [ ... snip ... ] >> @@ -99,6 +130,12 @@ static int livepatch_init(void) >> >> static void livepatch_exit(void) >> { >> +struct task_ctr *nd, *tmp; >> + >> +list_for_each_en

Re: [PATCH 3/3] livepatch: add shadow variable sample program

2017-06-09 Thread Josh Poimboeuf
On Thu, Jun 01, 2017 at 02:25:26PM -0400, Joe Lawrence wrote: > #include > +#include > static int livepatch_cmdline_proc_show(struct seq_file *m, void *v) > { > + struct task_ctr *nd; > + > + nd = klp_shadow_get(current, "task_ctr"); > + if (!nd) { > + nd = kzalloc(size

[PATCH 3/3] livepatch: add shadow variable sample program

2017-06-01 Thread Joe Lawrence
Modify the sample livepatch to demonstrate the shadow variable API. Signed-off-by: Joe Lawrence --- samples/livepatch/livepatch-sample.c | 39 +++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/samples/livepatch/livepatch-sample.c b/samples/livepa