diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2016-06-07 11:12:55 +0300 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-06-13 16:58:23 +0300 |
commit | d07a980c1b8d7ac18854bae94a4e7aeabce933b8 (patch) | |
tree | 80f32e86c81aa68b12944c0534938c758d7e405d /arch/s390/include/asm/cache.h | |
parent | 32fb2fc5c357fb99616bbe100dbcb27bc7f5d045 (diff) | |
download | linux-d07a980c1b8d7ac18854bae94a4e7aeabce933b8.tar.xz |
s390: add proper __ro_after_init support
On s390 __ro_after_init is currently mapped to __read_mostly which
means that data marked as __ro_after_init will not be protected.
Reason for this is that the common code __ro_after_init implementation
is x86 centric: the ro_after_init data section was added to rodata,
since x86 enables write protection to kernel text and rodata very
late. On s390 we have write protection for these sections enabled with
the initial page tables. So adding the ro_after_init data section to
rodata does not work on s390.
In order to make __ro_after_init work properly on s390 move the
ro_after_init data, right behind rodata. Unlike the rodata section it
will be marked read-only later after all init calls happened.
This s390 specific implementation adds new __start_ro_after_init and
__end_ro_after_init labels. Everything in between will be marked
read-only after the init calls happened. In addition to the
__ro_after_init data move also the exception table there, since from a
practical point of view it fits the __ro_after_init requirements.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/cache.h')
-rw-r--r-- | arch/s390/include/asm/cache.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h index 22da3b34c655..4d7ccac5fd1d 100644 --- a/arch/s390/include/asm/cache.h +++ b/arch/s390/include/asm/cache.h @@ -15,7 +15,4 @@ #define __read_mostly __attribute__((__section__(".data..read_mostly"))) -/* Read-only memory is marked before mark_rodata_ro() is called. */ -#define __ro_after_init __read_mostly - #endif |