Re: [PATCH] livepatch: support for repatching a function

From: Josh Poimboeuf
Date: Mon Jan 19 2015 - 09:54:39 EST


On Fri, Jan 16, 2015 at 05:51:11PM +0100, Jiri Kosina wrote:
> One thing that makes me worried here is we basically apply patches in a
> 'stackable' manner, but then this allows them to be removed (disabled) in
> an arbitrary order. Is this really the semantics we want?
>
> The scenario I am concerned about, in a nutshell:
>
> foo_unpatched()
> foo_patch1()
> foo_patch2()
> foo_patch3()
> disable(foo_patch2)
> disable(foo_patch3)
> foo_patch1()
>
> I.e. basically due to reverting of foo_patch2() while it wasn't in use, we
> turn subsequent revert of foo_patch3() into foo_patch1() state, although
> the function foo_patch3() was originally patching was foo_patch2().
>
> If this is implemented really in a fully stackable manner (i.e. you
> basically would be able to disable only the function that is currently
> "active", i.e. on top of the stack), woudln't that provide more
> predictable semantics?

Yes, I agree. Thanks for the comment.

Would you want to enforce stacking even if there are no dependencies
between the patches? I think that would be easiest (and cleanest).

--
Josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/