Re: [PATCH 1/6] livepatch v5: avoid race when checking for state of the patch

2014-12-11 Thread Josh Poimboeuf
On Thu, Dec 11, 2014 at 12:17:33PM +0100, Petr Mladek wrote: > On Wed 2014-12-10 09:25:06, Josh Poimboeuf wrote: > > On Wed, Dec 10, 2014 at 11:11:47AM +0100, Petr Mladek wrote: > > > On Tue 2014-12-09 12:32:49, Josh Poimboeuf wrote: > > But livepatch isn't a module, it's part of the kernel. > > A

Re: [PATCH 1/6] livepatch v5: avoid race when checking for state of the patch

2014-12-11 Thread Petr Mladek
On Wed 2014-12-10 09:25:06, Josh Poimboeuf wrote: > On Wed, Dec 10, 2014 at 11:11:47AM +0100, Petr Mladek wrote: > > On Tue 2014-12-09 12:32:49, Josh Poimboeuf wrote: > > > On Tue, Dec 09, 2014 at 07:05:02PM +0100, Petr Mladek wrote: > > > > klp_patch_enable() and klp_patch_disable() should check t

Re: [PATCH 1/6] livepatch v5: avoid race when checking for state of the patch

2014-12-10 Thread Josh Poimboeuf
On Wed, Dec 10, 2014 at 11:11:47AM +0100, Petr Mladek wrote: > On Tue 2014-12-09 12:32:49, Josh Poimboeuf wrote: > > On Tue, Dec 09, 2014 at 07:05:02PM +0100, Petr Mladek wrote: > > > klp_patch_enable() and klp_patch_disable() should check the current state > > > of the patch under the klp_lock. Ot

Re: [PATCH 1/6] livepatch v5: avoid race when checking for state of the patch

2014-12-10 Thread Petr Mladek
On Tue 2014-12-09 12:32:49, Josh Poimboeuf wrote: > On Tue, Dec 09, 2014 at 07:05:02PM +0100, Petr Mladek wrote: > > klp_patch_enable() and klp_patch_disable() should check the current state > > of the patch under the klp_lock. Otherwise, it might detect that the > > operation > > is valid but the

Re: [PATCH 1/6] livepatch v5: avoid race when checking for state of the patch

2014-12-09 Thread Josh Poimboeuf
On Tue, Dec 09, 2014 at 07:05:02PM +0100, Petr Mladek wrote: > klp_patch_enable() and klp_patch_disable() should check the current state > of the patch under the klp_lock. Otherwise, it might detect that the operation > is valid but the situation might change before it takes the lock. Hi Petr, Th

[PATCH 1/6] livepatch v5: avoid race when checking for state of the patch

2014-12-09 Thread Petr Mladek
klp_patch_enable() and klp_patch_disable() should check the current state of the patch under the klp_lock. Otherwise, it might detect that the operation is valid but the situation might change before it takes the lock. Signed-off-by: Petr Mladek --- kernel/livepatch/core.c | 16 ++--