Commit 8fe234d3c8d66771b327accb8eef26f70a8a8db8
Committed by
Martin Schwidefsky
1 parent
e76e82d772
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
s390/mm: fix mapping of read-only kernel text section
Within the identity mapping the kernel text section is mapped read-only. However when mapping the first and last page of the text section we must round upwards and downwards respectively, if only parts of a page belong to the section. Otherwise potential rw data can be mapped read-only. So the rounding must be done just the other way we have it right now. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
arch/s390/mm/vmem.c
... | ... | @@ -331,8 +331,8 @@ |
331 | 331 | unsigned long start, end; |
332 | 332 | int i; |
333 | 333 | |
334 | - ro_start = ((unsigned long)&_stext) & PAGE_MASK; | |
335 | - ro_end = PFN_ALIGN((unsigned long)&_eshared); | |
334 | + ro_start = PFN_ALIGN((unsigned long)&_stext); | |
335 | + ro_end = (unsigned long)&_eshared & PAGE_MASK; | |
336 | 336 | for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) { |
337 | 337 | if (memory_chunk[i].type == CHUNK_CRASHK || |
338 | 338 | memory_chunk[i].type == CHUNK_OLDMEM) |