Re: [PATCH v2 3/3] livepatch: Cleanup module page permission changes

Rusty Russell
2015-11-08T23:01:47Z

Josh Poimboeuf <jpoimboe@redhat.com> writes:
> On Fri, Nov 06, 2015 at 02:42:46PM +0100, Petr Mladek wrote:
>> naming schemes. What about adding into the public API?
>>
>> set_module_ro()
>> set_module_rw()
>>
>> It should modify everything: init, core, text, and data but only
>> the ro/rw flags.
>
> Even that naming is not without its problems. For example,
> set_module_ro() is false advertising -- it wouldn't change *all* module
> memory to be read-only. (It wouldn't touch the r/w data areas.)
>
> But I don't really care what the interfaces are called. It's really
> Rusty's call. I just stuck to the existing naming convention in the
> module code with the set/unset ro_nx stuff.

I'm looking at the ro/nx stuff now, and it seems like a mess. For
example, set_all_modules_text_rw() and set_all_modules_text_ro() use
mod->core_text_size instead of mod->core_ro_size. Which is probably
what they want (ftrace doesn't care about rodata) but pretty damn
confusing.

So I'll extend your cleanup. Expect a patch for testing RSN...

Thanks,
Rusty.