[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190614182341.sq4yngzmoobsyinq@treble>
Date: Fri, 14 Jun 2019 13:23:41 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Jessica Yu <jeyu@...nel.org>, Steven Rostedt <rostedt@...dmis.org>,
Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Joe Lawrence <joe.lawrence@...hat.com>,
linux-kernel@...r.kernel.org, live-patching@...r.kernel.org,
Johannes Erdfelt <johannes@...felt.com>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH 3/3] module: Improve module __ro_after_init handling
On Fri, Jun 14, 2019 at 04:14:53PM +0200, Petr Mladek wrote:
> > -void __module_enable_ro(const struct module *mod, bool after_init)
> > +static void __module_enable_ro(const struct module *mod)
> > {
> > if (!rodata_enabled)
> > return;
> > @@ -1973,15 +1973,15 @@ void __module_enable_ro(const struct module *mod, bool after_init)
> >
> > frob_rodata(&mod->init_layout, set_memory_ro);
> >
> > - if (after_init)
> > + if (mod->state == MODULE_STATE_LIVE)
> > frob_ro_after_init(&mod->core_layout, set_memory_ro);
>
> This works only now because __module_enable_ro() is called only from
> three locations (klp_init_object_loaded(), complete_formation(),
> and do_init_module(). And they all are called in a well defined order
> from load_module().
>
> Only the final call in do_init_module() should touch the after_init
> section.
>
> IMHO, the most clean solutiuon would be to call frob_ro_after_init()
> from extra __module_after_init_enable_ro() or so. This should be
> called only from the single place.
Agreed, that would be better. I'll be gone for a week but I'll make
these changes when I get back. Thanks.
--
Josh
Powered by blists - more mailing lists