Re: [PATCH] klp: make object/func-walking helpers more robust

2016-04-29 Thread Jiri Kosina
On Thu, 28 Apr 2016, Miroslav Benes wrote: > Current object-walking helper checks the presence of obj->funcs to > determine the end of objs array in klp_object structure. This is > somewhat fragile because one can easily forget about funcs definition > during livepatch creation. In such a case the

Re: klp: make object/func-walking helpers more robust

2016-04-29 Thread Jessica Yu
+++ Miroslav Benes [28/04/16 16:34 +0200]: Current object-walking helper checks the presence of obj->funcs to determine the end of objs array in klp_object structure. This is somewhat fragile because one can easily forget about funcs definition during livepatch creation. In such a case the livepa

Re: [PATCH] klp: make object/func-walking helpers more robust

2016-04-29 Thread Josh Poimboeuf
On Thu, Apr 28, 2016 at 04:34:08PM +0200, Miroslav Benes wrote: > Current object-walking helper checks the presence of obj->funcs to > determine the end of objs array in klp_object structure. This is > somewhat fragile because one can easily forget about funcs definition > during livepatch creation

Re: klp: make object/func-walking helpers more robust

2016-04-29 Thread Jessica Yu
+++ Miroslav Benes [29/04/16 09:48 +0200]: On Thu, 28 Apr 2016, Josh Poimboeuf wrote: On Thu, Apr 28, 2016 at 02:21:31PM -0400, Jessica Yu wrote: > +++ Miroslav Benes [28/04/16 16:34 +0200]: > > Current object-walking helper checks the presence of obj->funcs to > > determine the end of objs arr

Re: klp: make object/func-walking helpers more robust

2016-04-29 Thread Jiri Kosina
On Thu, 28 Apr 2016, Jessica Yu wrote: > > #define klp_for_each_object(patch, obj) \ > > - for (obj = patch->objs; obj->funcs; obj++) > > + for (obj = patch->objs; obj->funcs || obj->name; obj++) > > Remember that for patches to vmlinux, obj->name and obj->mod will also > both be NULL. So if

Re: klp: make object/func-walking helpers more robust

2016-04-29 Thread Miroslav Benes
On Thu, 28 Apr 2016, Josh Poimboeuf wrote: > On Thu, Apr 28, 2016 at 02:21:31PM -0400, Jessica Yu wrote: > > +++ Miroslav Benes [28/04/16 16:34 +0200]: > > > Current object-walking helper checks the presence of obj->funcs to > > > determine the end of objs array in klp_object structure. This is >

Re: klp: make object/func-walking helpers more robust

2016-04-28 Thread Josh Poimboeuf
On Thu, Apr 28, 2016 at 02:21:31PM -0400, Jessica Yu wrote: > +++ Miroslav Benes [28/04/16 16:34 +0200]: > > Current object-walking helper checks the presence of obj->funcs to > > determine the end of objs array in klp_object structure. This is > > somewhat fragile because one can easily forget abo

Re: klp: make object/func-walking helpers more robust

2016-04-28 Thread Jessica Yu
+++ Miroslav Benes [28/04/16 16:34 +0200]: Current object-walking helper checks the presence of obj->funcs to determine the end of objs array in klp_object structure. This is somewhat fragile because one can easily forget about funcs definition during livepatch creation. In such a case the livepa

[PATCH] klp: make object/func-walking helpers more robust

2016-04-28 Thread Miroslav Benes
Current object-walking helper checks the presence of obj->funcs to determine the end of objs array in klp_object structure. This is somewhat fragile because one can easily forget about funcs definition during livepatch creation. In such a case the livepatch module is successfully loaded and all obj