diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-16 09:09:24 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-16 09:09:24 +0200 |
commit | 500f0716b5f7fd6b0ff3d045588c7588ce2eee1d (patch) | |
tree | 05cfa2e77069af443f06bcfbf327f9aa2050eec7 /arch/arm/mm/init.c | |
parent | dt-bindings: usb-xhci: Add r8a77990 support (diff) | |
parent | Linux 4.18-rc5 (diff) | |
download | linux-500f0716b5f7fd6b0ff3d045588c7588ce2eee1d.tar.xz linux-500f0716b5f7fd6b0ff3d045588c7588ce2eee1d.zip |
Merge 4.18-rc5 into usb-next
We need the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r-- | arch/arm/mm/init.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index c186474422f3..0cc8e04295a4 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -736,20 +736,29 @@ static int __mark_rodata_ro(void *unused) return 0; } +static int kernel_set_to_readonly __read_mostly; + void mark_rodata_ro(void) { + kernel_set_to_readonly = 1; stop_machine(__mark_rodata_ro, NULL, NULL); debug_checkwx(); } void set_kernel_text_rw(void) { + if (!kernel_set_to_readonly) + return; + set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false, current->active_mm); } void set_kernel_text_ro(void) { + if (!kernel_set_to_readonly) + return; + set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true, current->active_mm); } |