linux/arch/s390/mm
Heiko Carstens 33bd8d153c s390: Keep inittext section writable
There is no added security by making the inittext section non-writable,
however it does split part of the kernel mapping into 4K mappings
instead of 1M 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 ]---

Keep the inittext writable and enable instruction execution protection
(aka noexec) later to prevent this. This also allows to use the
generic free_initmem() implementation.

---[ 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-0x000003ffe1800000         4M PMD RW NX <---
0x000003ffe1800000-0x000003ffe187e000       504K PTE RW NX
---[ Kernel Image End ]---

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2024-07-31 16:30:20 +02:00
..
cmm.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
dump_pagetables.c s390/mm/ptdump: Improve sorting of markers 2024-07-31 16:30:20 +02:00
extable.c s390: add support for DCACHE_WORD_ACCESS 2023-10-16 13:04:09 +02:00
extmem.c s390/extmem: fix virtual vs physical address confusion 2024-02-09 13:58:16 +01:00
fault.c s390/mm: Fix VM_FAULT_HWPOISON handling in do_exception() 2024-07-17 14:30:30 +02:00
gmap.c s390: Replace S390_lowcore by get_lowcore() 2024-06-18 17:01:33 +02:00
hugetlbpage.c - 875fa64577 ("mm/hugetlb_vmemmap: fix race with speculative PFN 2024-07-21 17:15:46 -07:00
init.c s390: Keep inittext section writable 2024-07-31 16:30:20 +02:00
maccess.c s390/uaccess: Make s390_kernel_write() usable for decompressor 2024-07-23 16:02:31 +02:00
Makefile s390/mm: provide simple ARCH_HAS_DEBUG_VIRTUAL support 2024-03-13 09:23:49 +01:00
mmap.c treewide: use initializer for struct vm_unmapped_area_info 2024-04-25 20:56:27 -07:00
page-states.c s390/cmma: rework no-dat handling 2023-11-05 22:34:58 +01:00
pageattr.c s390: Replace S390_lowcore by get_lowcore() 2024-06-18 17:01:33 +02:00
pfault.c s390/pfault: use consistent comment style 2023-07-29 14:57:18 +02:00
pgalloc.c s390 updates for 6.11 merge window 2024-07-18 15:41:45 -07:00
pgtable.c mm/treewide: replace pud_large() with pud_leaf() 2024-03-06 13:04:19 -08:00
physaddr.c s390/mm: provide simple ARCH_HAS_DEBUG_VIRTUAL support 2024-03-13 09:23:49 +01:00
vmem.c s390: Keep inittext section writable 2024-07-31 16:30:20 +02:00