Skip to content

Commit 8b050fe

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "Although we're still debugging a few minor arm64-specific issues in mainline, I didn't want to hold this lot up in the meantime. We've got an additional KASLR fix after the previous one wasn't quite complete, a fix for a performance regression when mapping executable pages into userspace and some fixes for kprobe blacklisting. All candidates for stable. Summary: - Fix module loading when KASLR is configured but disabled at runtime - Fix accidental IPI when mapping user executable pages - Ensure hyp-stub and KVM world switch code cannot be kprobed" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: hibernate: Clean the __hyp_text to PoC after resume arm64: hyp-stub: Forbid kprobing of the hyp-stub arm64: kprobe: Always blacklist the KVM world-switch code arm64: kaslr: ensure randomized quantities are clean also when kaslr is off arm64: Do not issue IPIs for user executable ptes
2 parents 33640d7 + f7daa9c commit 8b050fe

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

arch/arm64/kernel/hibernate.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,10 @@ int swsusp_arch_suspend(void)
299299
dcache_clean_range(__idmap_text_start, __idmap_text_end);
300300

301301
/* Clean kvm setup code to PoC? */
302-
if (el2_reset_needed())
302+
if (el2_reset_needed()) {
303303
dcache_clean_range(__hyp_idmap_text_start, __hyp_idmap_text_end);
304+
dcache_clean_range(__hyp_text_start, __hyp_text_end);
305+
}
304306

305307
/* make the crash dump kernel image protected again */
306308
crash_post_resume();

arch/arm64/kernel/hyp-stub.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <asm/virt.h>
2929

3030
.text
31+
.pushsection .hyp.text, "ax"
32+
3133
.align 11
3234

3335
ENTRY(__hyp_stub_vectors)

arch/arm64/kernel/kaslr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ u64 __init kaslr_early_init(u64 dt_phys)
8888
* we end up running with module randomization disabled.
8989
*/
9090
module_alloc_base = (u64)_etext - MODULES_VSIZE;
91+
__flush_dcache_area(&module_alloc_base, sizeof(module_alloc_base));
9192

9293
/*
9394
* Try to map the FDT early. If this fails, we simply bail,

arch/arm64/kernel/probes/kprobes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,13 @@ bool arch_within_kprobe_blacklist(unsigned long addr)
478478
addr < (unsigned long)__entry_text_end) ||
479479
(addr >= (unsigned long)__idmap_text_start &&
480480
addr < (unsigned long)__idmap_text_end) ||
481+
(addr >= (unsigned long)__hyp_text_start &&
482+
addr < (unsigned long)__hyp_text_end) ||
481483
!!search_exception_tables(addr))
482484
return true;
483485

484486
if (!is_kernel_in_hyp_mode()) {
485-
if ((addr >= (unsigned long)__hyp_text_start &&
486-
addr < (unsigned long)__hyp_text_end) ||
487-
(addr >= (unsigned long)__hyp_idmap_text_start &&
487+
if ((addr >= (unsigned long)__hyp_idmap_text_start &&
488488
addr < (unsigned long)__hyp_idmap_text_end))
489489
return true;
490490
}

arch/arm64/mm/flush.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ void sync_icache_aliases(void *kaddr, unsigned long len)
3333
__clean_dcache_area_pou(kaddr, len);
3434
__flush_icache_all();
3535
} else {
36-
flush_icache_range(addr, addr + len);
36+
/*
37+
* Don't issue kick_all_cpus_sync() after I-cache invalidation
38+
* for user mappings.
39+
*/
40+
__flush_icache_range(addr, addr + len);
3741
}
3842
}
3943

0 commit comments

Comments
 (0)