linux/arch/s390
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
..
appldata sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
boot more s390 updates for 6.11 merge window 2024-07-26 10:47:53 -07:00
configs s390: Remove protvirt and kvm config guards for uv code 2024-07-23 16:02:33 +02:00
crypto s390/crc32: Add missing MODULE_DESCRIPTION() macro 2024-06-28 14:52:30 +02:00
hypfs s390/hypfs_diag: Diag204 busy loop 2024-07-10 19:50:45 +02:00
include more s390 updates for 6.11 merge window 2024-07-26 10:47:53 -07:00
kernel s390/vmlinux.lds.S: Move ro_after_init section behind rodata section 2024-07-31 16:30:20 +02:00
kvm ARM: 2024-07-20 12:41:03 -07:00
lib s390/alternatives: Rework to allow for callbacks 2024-07-23 16:02:31 +02:00
mm s390: Keep inittext section writable 2024-07-31 16:30:20 +02:00
net s390/bpf: Implement exceptions 2024-07-08 16:39:35 +02:00
pci s390/pci: Allow allocation of more than 1 MSI interrupt 2024-07-23 15:54:58 +02:00
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
tools s390/boot: Rework deployment of the kernel image 2024-04-17 13:38:02 +02:00
Kbuild - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
Kconfig s390: Remove protvirt and kvm config guards for uv code 2024-07-23 16:02:33 +02:00
Kconfig.debug s390/Kconfig.debug: fix indentation 2022-06-01 12:03:15 +02:00
Makefile s390: use a larger stack for KMSAN 2024-07-03 19:30:24 -07:00