Re: [RFC PATCH 0/2] kpatch: dynamic kernel patching

From: Jiri Kosina
Date: Tue May 20 2014 - 05:37:24 EST


On Fri, 16 May 2014, Josh Poimboeuf wrote:

> > Consider this scenario:
> >
> > void foo()
> > {
> > for (i=0; i<10000; i++) {
> > bar(i);
> > something_else(i);
> > }
> > }
> >
> > Let's say you want to live-patch bar(). With stop_machine()-based aproach,
> > you can easily end-up with old bar() and new bar() being called in two
> > consecutive iterations before the loop is even exited, right? (especially
> > on preemptible kernel, or if something_else() goes to sleep).
>
> Can you clarify why this would be a problem? Is it because the new
> bar() changed some data semantics which confused foo() or
> something_else()?

I guess the example I used wasn't really completely illustrative, sorry
for that. But I guess this has been answered later in the thread already;
the thing is that you don't have a complete callgraph available (at least
I believe you don't ...?), so you don't really know where your patched
function will be called from, and thus you can't change function arguments
or return value semantics; with lazy aproach, you can do that.

Thanks,

--
Jiri Kosina
SUSE Labs
--
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/