[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 3 Mar 2015 13:35:39 -0600
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Petr Mladek <pmladek@...e.cz>
Cc: Seth Jennings <sjenning@...hat.com>, Jiri Kosina <jkosina@...e.cz>,
Rusty Russell <rusty@...tcorp.com.au>,
Miroslav Benes <mbenes@...e.cz>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
mingo@...nel.org, mathieu.desnoyers@...icios.com, oleg@...hat.com,
paulmck@...ux.vnet.ibm.com, linux-kernel@...r.kernel.org,
andi@...stfloor.org, rostedt@...dmis.org, tglx@...utronix.de
Subject: Re: [RFC PATCH] livepatch/module: Do not patch modules that are not
ready
On Tue, Mar 03, 2015 at 01:31:28PM -0600, Josh Poimboeuf wrote:
> @@ -89,16 +89,29 @@ static bool klp_is_object_loaded(struct klp_object *obj)
> /* sets obj->mod if object is not vmlinux and module is found */
> static void klp_find_object_module(struct klp_object *obj)
> {
> - if (!klp_is_module(obj))
> + struct module *mod;
> +
> + if (!klp_is_module(obj) || obj->mod)
> return;
>
> mutex_lock(&module_mutex);
> +
> /*
> * We don't need to take a reference on the module here because we have
> * the klp_mutex, which is also taken by the module notifier. This
> * prevents any module from unloading until we release the klp_mutex.
> */
> - obj->mod = find_module(obj->name);
> + mod = find_module(obj->name);
> +
> + /*
> + * MODULE_STATE_COMING means we got to the module first before the
> + * notifier did. ftrace is already initialized, so it's fine to go
> + * ahead and start using it.
> + */
This comment should probably be improved to say:
"MODULE_STATE_COMING and !obj->mod means..."
--
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