Re: module: save load_info for livepatch modules

2015-11-16 Thread Miroslav Benes
On Fri, 13 Nov 2015, Jessica Yu wrote: > +++ Miroslav Benes [13/11/15 13:56 +0100]: > > On Fri, 13 Nov 2015, Miroslav Benes wrote: > > > > > I agree this seems like the best approach. So if we preserve > > > mod_arch_syminfo (in case of s390) we should free it not in > > > module_finalize, but so

Re: module: save load_info for livepatch modules

2015-11-16 Thread Miroslav Benes
On Fri, 13 Nov 2015, Jessica Yu wrote: > +++ Miroslav Benes [13/11/15 13:46 +0100]: > > On Fri, 13 Nov 2015, Miroslav Benes wrote: > > > > > As for load_info, I don't have a strong opinion whether to keep it for all > > > modules or for livepatch modules only. > > > > I have. We cannot keep it,

Re: module: save load_info for livepatch modules

2015-11-13 Thread Jessica Yu
+++ Miroslav Benes [13/11/15 13:56 +0100]: On Fri, 13 Nov 2015, Miroslav Benes wrote: I agree this seems like the best approach. So if we preserve mod_arch_syminfo (in case of s390) we should free it not in module_finalize, but somewhere in free_module... where module_arch_cleanup() is called..

Re: module: save load_info for livepatch modules

2015-11-13 Thread Jessica Yu
+++ Miroslav Benes [13/11/15 13:46 +0100]: On Fri, 13 Nov 2015, Miroslav Benes wrote: As for load_info, I don't have a strong opinion whether to keep it for all modules or for livepatch modules only. I have. We cannot keep it, even for livepatch modules... In info->hdr there is a temporary c

Re: module: save load_info for livepatch modules

2015-11-13 Thread Miroslav Benes
On Fri, 13 Nov 2015, Jessica Yu wrote: > +++ Miroslav Benes [12/11/15 15:19 +0100]: > > On Thu, 12 Nov 2015, Petr Mladek wrote: > > > > > On Wed 2015-11-11 23:44:08, Jessica Yu wrote: > > > > +++ Petr Mladek [11/11/15 15:31 +0100]: > > > > >On Mon 2015-11-09 23:45:52, Jessica Yu wrote: > > > > >>

Re: module: save load_info for livepatch modules

2015-11-13 Thread Miroslav Benes
On Fri, 13 Nov 2015, Miroslav Benes wrote: > I agree this seems like the best approach. So if we preserve > mod_arch_syminfo (in case of s390) we should free it not in > module_finalize, but somewhere in free_module... where > module_arch_cleanup() is called... and also module_arch_freeing_init

Re: module: save load_info for livepatch modules

2015-11-13 Thread Miroslav Benes
On Fri, 13 Nov 2015, Miroslav Benes wrote: > As for load_info, I don't have a strong opinion whether to keep it for all > modules or for livepatch modules only. I have. We cannot keep it, even for livepatch modules... In info->hdr there is a temporary copy of the whole module (see init_module

Re: module: save load_info for livepatch modules

2015-11-13 Thread Miroslav Benes
On Thu, 12 Nov 2015, Jessica Yu wrote: > +++ Josh Poimboeuf [12/11/15 11:05 -0600]: > > On Thu, Nov 12, 2015 at 04:03:45PM +0100, Petr Mladek wrote: > > > On Thu 2015-11-12 14:22:28, Miroslav Benes wrote: > > > > On Thu, 12 Nov 2015, Petr Mladek wrote: > > > > > > >Maybe I am missing something but

Re: module: save load_info for livepatch modules

2015-11-13 Thread Jessica Yu
+++ Petr Mladek [12/11/15 11:05 +0100]: On Wed 2015-11-11 23:44:08, Jessica Yu wrote: +++ Petr Mladek [11/11/15 15:31 +0100]: >On Mon 2015-11-09 23:45:52, Jessica Yu wrote: >>diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c >>index 6e53441..087a8c7 100644 >>--- a/kernel/livepatch/c

Re: module: save load_info for livepatch modules

2015-11-12 Thread Jessica Yu
+++ Miroslav Benes [12/11/15 15:19 +0100]: On Thu, 12 Nov 2015, Petr Mladek wrote: On Wed 2015-11-11 23:44:08, Jessica Yu wrote: > +++ Petr Mladek [11/11/15 15:31 +0100]: > >On Mon 2015-11-09 23:45:52, Jessica Yu wrote: > >>diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > >>inde

Re: module: save load_info for livepatch modules

2015-11-12 Thread Jessica Yu
+++ Miroslav Benes [12/11/15 14:22 +0100]: On Thu, 12 Nov 2015, Petr Mladek wrote: On Thu 2015-11-12 00:33:12, Jessica Yu wrote: > +++ Miroslav Benes [11/11/15 15:17 +0100]: > >On Mon, 9 Nov 2015, Jessica Yu wrote: > > > >>diff --git a/include/linux/module.h b/include/linux/module.h > >>index 3

Re: module: save load_info for livepatch modules

2015-11-12 Thread Jessica Yu
+++ Josh Poimboeuf [12/11/15 11:05 -0600]: On Thu, Nov 12, 2015 at 04:03:45PM +0100, Petr Mladek wrote: On Thu 2015-11-12 14:22:28, Miroslav Benes wrote: > On Thu, 12 Nov 2015, Petr Mladek wrote: > > > >Maybe I am missing something but isn't it necessary to call vfree() on > > > >info somewhere

Re: [RFC PATCH 2/5] module: save load_info for livepatch modules

2015-11-12 Thread Josh Poimboeuf
On Mon, Nov 09, 2015 at 11:45:52PM -0500, Jessica Yu wrote: > In livepatch modules, preserve section, symbol, string information from > the load_info struct in the module loader. This information is used to > patch modules that are not loaded in memory yet; specifically it is used > to resolve rema

Re: [RFC PATCH 2/5] module: save load_info for livepatch modules

2015-11-12 Thread Josh Poimboeuf
On Mon, Nov 09, 2015 at 11:45:52PM -0500, Jessica Yu wrote: > In livepatch modules, preserve section, symbol, string information from > the load_info struct in the module loader. This information is used to > patch modules that are not loaded in memory yet; specifically it is used > to resolve rema

Re: module: save load_info for livepatch modules

2015-11-12 Thread Josh Poimboeuf
On Thu, Nov 12, 2015 at 04:03:45PM +0100, Petr Mladek wrote: > On Thu 2015-11-12 14:22:28, Miroslav Benes wrote: > > On Thu, 12 Nov 2015, Petr Mladek wrote: > > > > >Maybe I am missing something but isn't it necessary to call vfree() on > > > > >info somewhere in the end? > > > > > > > > So free_c

Re: module: save load_info for livepatch modules

2015-11-12 Thread Petr Mladek
On Thu 2015-11-12 14:22:28, Miroslav Benes wrote: > On Thu, 12 Nov 2015, Petr Mladek wrote: > > > >Maybe I am missing something but isn't it necessary to call vfree() on > > > >info somewhere in the end? > > > > > > So free_copy() will call vfree(info->hdr), except in livepatch modules > > > we wa

Re: module: save load_info for livepatch modules

2015-11-12 Thread Miroslav Benes
On Thu, 12 Nov 2015, Petr Mladek wrote: > On Wed 2015-11-11 23:44:08, Jessica Yu wrote: > > +++ Petr Mladek [11/11/15 15:31 +0100]: > > >On Mon 2015-11-09 23:45:52, Jessica Yu wrote: > > >>diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > > >>index 6e53441..087a8c7 100644 > > >>---

Re: module: save load_info for livepatch modules

2015-11-12 Thread Miroslav Benes
On Thu, 12 Nov 2015, Petr Mladek wrote: > On Thu 2015-11-12 00:33:12, Jessica Yu wrote: > > +++ Miroslav Benes [11/11/15 15:17 +0100]: > > >On Mon, 9 Nov 2015, Jessica Yu wrote: > > > > > >>diff --git a/include/linux/module.h b/include/linux/module.h > > >>index 3a19c79..c8680b1 100644 > > >>--- a

Re: module: save load_info for livepatch modules

2015-11-12 Thread Petr Mladek
On Thu 2015-11-12 00:33:12, Jessica Yu wrote: > +++ Miroslav Benes [11/11/15 15:17 +0100]: > >On Mon, 9 Nov 2015, Jessica Yu wrote: > > > >>diff --git a/include/linux/module.h b/include/linux/module.h > >>index 3a19c79..c8680b1 100644 > >>--- a/include/linux/module.h > >>+++ b/include/linux/module.

Re: module: save load_info for livepatch modules

2015-11-12 Thread Petr Mladek
On Wed 2015-11-11 23:44:08, Jessica Yu wrote: > +++ Petr Mladek [11/11/15 15:31 +0100]: > >On Mon 2015-11-09 23:45:52, Jessica Yu wrote: > >>diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > >>index 6e53441..087a8c7 100644 > >>--- a/kernel/livepatch/core.c > >>+++ b/kernel/livepatch/

Re: module: save load_info for livepatch modules

2015-11-11 Thread Jessica Yu
+++ Miroslav Benes [11/11/15 15:17 +0100]: On Mon, 9 Nov 2015, Jessica Yu wrote: diff --git a/include/linux/module.h b/include/linux/module.h index 3a19c79..c8680b1 100644 --- a/include/linux/module.h +++ b/include/linux/module.h [...] +#ifdef CONFIG_LIVEPATCH +extern void klp_prepare_patch

Re: module: save load_info for livepatch modules

2015-11-11 Thread Jessica Yu
+++ Petr Mladek [11/11/15 15:31 +0100]: On Mon 2015-11-09 23:45:52, Jessica Yu wrote: In livepatch modules, preserve section, symbol, string information from the load_info struct in the module loader. This information is used to patch modules that are not loaded in memory yet; specifically it is

Re: [RFC PATCH 2/5] module: save load_info for livepatch modules

2015-11-11 Thread Petr Mladek
On Mon 2015-11-09 23:45:52, Jessica Yu wrote: > In livepatch modules, preserve section, symbol, string information from > the load_info struct in the module loader. This information is used to > patch modules that are not loaded in memory yet; specifically it is used > to resolve remaining symbols

Re: [RFC PATCH 2/5] module: save load_info for livepatch modules

2015-11-11 Thread Miroslav Benes
On Mon, 9 Nov 2015, Jessica Yu wrote: > diff --git a/include/linux/module.h b/include/linux/module.h > index 3a19c79..c8680b1 100644 > --- a/include/linux/module.h > +++ b/include/linux/module.h [...] > +#ifdef CONFIG_LIVEPATCH > +extern void klp_prepare_patch_module(struct module *mod, > +

Re: [RFC PATCH 2/5] module: save load_info for livepatch modules

2015-11-11 Thread Minfei Huang
On 11/09/15 at 11:45pm, Jessica Yu wrote: > In livepatch modules, preserve section, symbol, string information from > the load_info struct in the module loader. This information is used to > patch modules that are not loaded in memory yet; specifically it is used > to resolve remaining symbols and

[RFC PATCH 2/5] module: save load_info for livepatch modules

2015-11-09 Thread Jessica Yu
In livepatch modules, preserve section, symbol, string information from the load_info struct in the module loader. This information is used to patch modules that are not loaded in memory yet; specifically it is used to resolve remaining symbols and write relocations when the target module loads. S