Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

s390/boot: Respect kaslr_enabled() for identity randomization

CONFIG_RANDOMIZE_IDENTITY_BASE only enables support for randomizing the
identity mapping base. The randomization (identity base != 0) itself
should happen only when KASLR is enabled at runtime.

Guard the __identity_base update with kaslr_enabled() so nokaslr (and
other KASLR-disabled cases) keep the non-randomized identity mapping at 0.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

+2 -1
+2 -1
arch/s390/boot/startup.c
··· 440 440 max_mappable = max(ident_map_size, MAX_DCSS_ADDR); 441 441 max_mappable = min(max_mappable, vmemmap_start); 442 442 #ifdef CONFIG_RANDOMIZE_IDENTITY_BASE 443 - __identity_base = round_down(vmemmap_start - max_mappable, rte_size); 443 + if (kaslr_enabled()) 444 + __identity_base = round_down(vmemmap_start - max_mappable, rte_size); 444 445 #endif 445 446 boot_debug("identity map: 0x%016lx-0x%016lx\n", __identity_base, 446 447 __identity_base + ident_map_size);