Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1434225

Re: modules: add ro_after_init support

From Rusty Russell <rusty@rustcorp.com.au>
Newsgroups linux.kernel
Subject Re: modules: add ro_after_init support
Date 2016-06-30 07:10 +0200
Message-ID <rPCoF-5s7-5@gated-at.bofh.it> (permalink)
References <rJKff-5r8-5@gated-at.bofh.it> <rJKfg-5r8-11@gated-at.bofh.it> <rPcky-625-3@gated-at.bofh.it> <rPvdw-Tj-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Jessica Yu <jeyu@redhat.com> writes:
> +++ Rusty Russell [29/06/16 10:38 +0930]:
>>Jessica Yu <jeyu@redhat.com> writes:
>>> Add ro_after_init support for modules by adding a new page-aligned section
>>> in the module layout (after rodata) for ro_after_init data and enabling RO
>>> protection for that section after module init runs.
>>>
>>> Signed-off-by: Jessica Yu <jeyu@redhat.com>
>>
>>I would prefer a "bool after_init" flag to module_enable_ro().  It's
>>more explicit.
>
> Sure thing, I was just initially worried about the
> module_{enable,disable}_ro() asymmetry. :)

Yes, but I think compile-time-analyzable behaviour beats
runtime-analyzable behaviour for clarity.

>>Exposing the flags via uapi looks like a wart, but it's kind of a
>>feature, since we don't *unset* it in any section; userspace may want to
>>know about it.
>
> Hm, I'm still unsure about this. I'm starting to think it might be a
> bit overkill to expose SHF_RO_AFTER_INIT through uapi (although that
> is where all the other SHF_* flags are defined) SHF_RO_AFTER_INIT
> would technically be used only internally in the kernel (i.e. module
> loader), and it'd also be considered a non-standard flag, using a bit
> from SHF_MASKOS (OS-specific range). What do you think?

Some arch *could* use it by setting the flag in a section in their
module I think; we don't stop them.  Since the other flags are there,
I'd leave it.

We don't expose the flags via sysfs, though, so that's the only
exposure.

Thanks!
Rusty.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/1] modules: add ro_after_init support Rusty Russell <rusty@rustcorp.com.au> - 2016-06-29 03:20 +0200
  Re: modules: add ro_after_init support Jessica Yu <jeyu@redhat.com> - 2016-06-29 23:30 +0200
    Re: modules: add ro_after_init support Rusty Russell <rusty@rustcorp.com.au> - 2016-06-30 07:10 +0200

csiph-web