Skip to content

Commit 75c10d5

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/vmlinux.lds.S: Move ro_after_init section behind rodata section
The .data.rel.ro and .got section were added between the rodata and ro_after_init data section, which adds an RW mapping in between all RO mapping of the kernel image: ---[ Kernel Image Start ]--- 0x000003ffe0000000-0x000003ffe0e00000 14M PMD RO X 0x000003ffe0e00000-0x000003ffe0ec7000 796K PTE RO X 0x000003ffe0ec7000-0x000003ffe0f00000 228K PTE RO NX 0x000003ffe0f00000-0x000003ffe1300000 4M PMD RO NX 0x000003ffe1300000-0x000003ffe1331000 196K PTE RO NX 0x000003ffe1331000-0x000003ffe13b3000 520K PTE RW NX <--- 0x000003ffe13b3000-0x000003ffe13d5000 136K PTE RO NX 0x000003ffe13d5000-0x000003ffe1400000 172K PTE RW NX 0x000003ffe1400000-0x000003ffe1500000 1M PMD RW NX 0x000003ffe1500000-0x000003ffe1700000 2M PTE RW NX 0x000003ffe1700000-0x000003ffe1800000 1M PMD RW NX 0x000003ffe1800000-0x000003ffe187e000 504K PTE RW NX ---[ Kernel Image End ]--- Move the ro_after_init data section again right behind the rodata section to prevent interleaving RO and RW mappings: ---[ Kernel Image Start ]--- 0x000003ffe0000000-0x000003ffe0e00000 14M PMD RO X 0x000003ffe0e00000-0x000003ffe0ec7000 796K PTE RO X 0x000003ffe0ec7000-0x000003ffe0f00000 228K PTE RO NX 0x000003ffe0f00000-0x000003ffe1300000 4M PMD RO NX 0x000003ffe1300000-0x000003ffe1353000 332K PTE RO NX 0x000003ffe1353000-0x000003ffe1400000 692K PTE RW NX 0x000003ffe1400000-0x000003ffe1500000 1M PMD RW NX 0x000003ffe1500000-0x000003ffe1700000 2M PTE RW NX 0x000003ffe1700000-0x000003ffe1800000 1M PMD RW NX 0x000003ffe1800000-0x000003ffe187e000 504K PTE RW NX ---[ Kernel Image End ]--- Reviewed-by: Alexander Gordeev <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 1e72ba5 commit 75c10d5

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

arch/s390/kernel/vmlinux.lds.S

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ SECTIONS
5959
} :text = 0x0700
6060

6161
RO_DATA(PAGE_SIZE)
62-
.data.rel.ro : {
63-
*(.data.rel.ro .data.rel.ro.*)
64-
}
65-
.got : {
66-
__got_start = .;
67-
*(.got)
68-
__got_end = .;
69-
}
7062

7163
. = ALIGN(PAGE_SIZE);
7264
_sdata = .; /* Start of data section */
@@ -80,6 +72,15 @@ SECTIONS
8072
. = ALIGN(PAGE_SIZE);
8173
__end_ro_after_init = .;
8274

75+
.data.rel.ro : {
76+
*(.data.rel.ro .data.rel.ro.*)
77+
}
78+
.got : {
79+
__got_start = .;
80+
*(.got)
81+
__got_end = .;
82+
}
83+
8384
RW_DATA(0x100, PAGE_SIZE, THREAD_SIZE)
8485
.data.rel : {
8586
*(.data.rel*)

0 commit comments

Comments
 (0)