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.

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:
"Three arm64 fixes for -rc3.

We've plugged a couple of nasty issues involving KASLR-enabled
kernels, and removed a redundant #define that was introduced as part
of the KHWASAN fixes from akpm at -rc2.

- Fix broken kpti page-table rewrite in bizarre KASLR configuration

- Fix module loading with KASLR

- Remove redundant definition of ARCH_SLAB_MINALIGN"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
kasan, arm64: remove redundant ARCH_SLAB_MINALIGN define
arm64: kaslr: ensure randomized quantities are clean to the PoC
arm64: kpti: Update arm64_kernel_use_ng_mappings() when forced on

+10 -5
-2
arch/arm64/include/asm/cache.h
··· 60 60 61 61 #ifdef CONFIG_KASAN_SW_TAGS 62 62 #define ARCH_SLAB_MINALIGN (1ULL << KASAN_SHADOW_SCALE_SHIFT) 63 - #else 64 - #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) 65 63 #endif 66 64 67 65 #ifndef __ASSEMBLY__
+4 -1
arch/arm64/include/asm/mmu.h
··· 60 60 * later determine that kpti is required, then 61 61 * kpti_install_ng_mappings() will make them non-global. 62 62 */ 63 + if (arm64_kernel_unmapped_at_el0()) 64 + return true; 65 + 63 66 if (!IS_ENABLED(CONFIG_RANDOMIZE_BASE)) 64 - return arm64_kernel_unmapped_at_el0(); 67 + return false; 65 68 66 69 /* 67 70 * KASLR is enabled so we're going to be enabling kpti on non-broken
+6 -2
arch/arm64/kernel/kaslr.c
··· 14 14 #include <linux/sched.h> 15 15 #include <linux/types.h> 16 16 17 + #include <asm/cacheflush.h> 17 18 #include <asm/fixmap.h> 18 19 #include <asm/kernel-pgtable.h> 19 20 #include <asm/memory.h> ··· 44 43 return ret; 45 44 } 46 45 47 - static __init const u8 *get_cmdline(void *fdt) 46 + static __init const u8 *kaslr_get_cmdline(void *fdt) 48 47 { 49 48 static __initconst const u8 default_cmdline[] = CONFIG_CMDLINE; 50 49 ··· 110 109 * Check if 'nokaslr' appears on the command line, and 111 110 * return 0 if that is the case. 112 111 */ 113 - cmdline = get_cmdline(fdt); 112 + cmdline = kaslr_get_cmdline(fdt); 114 113 str = strstr(cmdline, "nokaslr"); 115 114 if (str == cmdline || (str > cmdline && *(str - 1) == ' ')) 116 115 return 0; ··· 169 168 /* use the lower 21 bits to randomize the base of the module region */ 170 169 module_alloc_base += (module_range * (seed & ((1 << 21) - 1))) >> 21; 171 170 module_alloc_base &= PAGE_MASK; 171 + 172 + __flush_dcache_area(&module_alloc_base, sizeof(module_alloc_base)); 173 + __flush_dcache_area(&memstart_offset_seed, sizeof(memstart_offset_seed)); 172 174 173 175 return offset; 174 176 }