[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150515151556.GA4259@treble.redhat.com>
Date: Fri, 15 May 2015 10:15:56 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Minfei Huang <mhuang@...hat.com>
Cc: sjenning@...hat.com, jkosina@...e.cz, vojtech@...e.cz,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org,
Minfei Huang <mnfhuang@...il.com>
Subject: Re: [PATCH v5] livepatch: Prevent patch inconsistencies if the
coming module notifier fails
On Fri, May 15, 2015 at 10:22:48AM +0800, Minfei Huang wrote:
> From: Minfei Huang <mnfhuang@...il.com>
>
> The previous patches can be applied, once the corresponding module is
> loaded. In general, the patch will do relocation (if necessary) and
> obtain/verify function address before we start to enable patch.
>
> There are three different situations in which the coming module notifier
> can fail:
>
> 1) relocations are not applied for some reason. In this case kallsyms
> for module symbol is not called at all. The patch is not applied to the
> module. If the user disable and enable patch again, there is possible
> bug in klp_enable_func. If the user specified func->old_addr for some
> function in the module (and he shouldn't do that, but nevertheless) our
> warning would not catch it, ftrace will reject to register the handler
> because of wrong address or will register the handler for wrong address.
>
> 2) relocations are applied successfully, but kallsyms lookup fails. In
> this case func->old_addr can be correct for all previous lookups, 0 for
> current failed one, and "unspecified" for the rest. If we undergo the
> same scenario as in 1, the behaviour differs for three cases, but the
> patch is not enabled anyway.
>
> 3) the object is initialized, but klp_enable_object fails in the
> notifier due to possible ftrace error. Since it is improbable that
> ftrace would heal itself in the future, we would get those errors
> everytime the patch is enabled.
>
> In order to fix above situations, we can make obj->mod to NULL, if the
> coming modified notifier fails.
>
> Signed-off-by: Minfei Huang <mnfhuang@...il.com>
Acked-by: Josh Poimboeuf <jpoimboe@...hat.com>
Thanks!
--
Josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists