aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-06-23 16:28:47 -0400
committerRussell King <rmk+kernel@armlinux.org.uk>2016-07-02 06:01:30 -0400
commit14c4a533e0996f95a0a64dfd0b6252d788cebc74 (patch)
treeadf6541d18a25971d9155e3f1502fd75a5aa658f
parent520319de0ced43c21c0aaef3c2392fb607d05419 (diff)
ARM: 8583/1: mm: fix location of _etext
The _etext position is defined to be the end of the kernel text code, and should not include any part of the data segments. This interferes with things that might check memory ranges and expect executable code up to _etext. Just to be conservative, leave the kernel resource as it was, using __init_begin instead of _etext as the end mark. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/kernel/setup.c2
-rw-r--r--arch/arm/kernel/vmlinux.lds.S4
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 7b5350060612..dd84f03dc2d4 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -844,7 +844,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
844 struct resource *res; 844 struct resource *res;
845 845
846 kernel_code.start = virt_to_phys(_text); 846 kernel_code.start = virt_to_phys(_text);
847 kernel_code.end = virt_to_phys(_etext - 1); 847 kernel_code.end = virt_to_phys(__init_begin - 1);
848 kernel_data.start = virt_to_phys(_sdata); 848 kernel_data.start = virt_to_phys(_sdata);
849 kernel_data.end = virt_to_phys(_end - 1); 849 kernel_data.end = virt_to_phys(_end - 1);
850 850
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index e2c6da096cef..99420fc1f066 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -125,6 +125,8 @@ SECTIONS
125#ifdef CONFIG_DEBUG_ALIGN_RODATA 125#ifdef CONFIG_DEBUG_ALIGN_RODATA
126 . = ALIGN(1<<SECTION_SHIFT); 126 . = ALIGN(1<<SECTION_SHIFT);
127#endif 127#endif
128 _etext = .; /* End of text section */
129
128 RO_DATA(PAGE_SIZE) 130 RO_DATA(PAGE_SIZE)
129 131
130 . = ALIGN(4); 132 . = ALIGN(4);
@@ -155,8 +157,6 @@ SECTIONS
155 157
156 NOTES 158 NOTES
157 159
158 _etext = .; /* End of text and rodata section */
159
160#ifdef CONFIG_DEBUG_RODATA 160#ifdef CONFIG_DEBUG_RODATA
161 . = ALIGN(1<<SECTION_SHIFT); 161 . = ALIGN(1<<SECTION_SHIFT);
162#else 162#else