arm64: hyp-stub: Forbid kprobing of the hyp-stub
authorJames Morse <[email protected]>
Thu, 24 Jan 2019 16:32:56 +0000 (16:32 +0000)
committerWill Deacon <[email protected]>
Fri, 1 Feb 2019 14:10:01 +0000 (14:10 +0000)
The hyp-stub is loaded by the kernel's early startup code at EL2
during boot, before KVM takes ownership later. The hyp-stub's
text is part of the regular kernel text, meaning it can be kprobed.

A breakpoint in the hyp-stub causes the CPU to spin in el2_sync_invalid.

Add it to the __hyp_text.

Signed-off-by: James Morse <[email protected]>
Cc: [email protected]
Signed-off-by: Will Deacon <[email protected]>
arch/arm64/kernel/hyp-stub.S

index e1261fbaa374e02471214664df742cb26c4da1d7..17f325ba831e8299131415390a2b40494412709d 100644 (file)
@@ -28,6 +28,8 @@
 #include <asm/virt.h>
 
        .text
+       .pushsection    .hyp.text, "ax"
+
        .align 11
 
 ENTRY(__hyp_stub_vectors)