arm64: entry.S: Add ventry overflow sanity checks

commit 4330e2c5c0 upstream.

Subsequent patches add even more code to the ventry slots.
Ensure kernels that overflow a ventry slot don't get built.

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
James Morse
2022-04-06 17:45:28 +01:00
committed by Chris
parent e4534d8dab
commit 7a2211bb98

View File

@@ -76,6 +76,7 @@
.macro kernel_ventry, el, label, regsize = 64
.align 7
.Lventry_start\@:
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
alternative_if ARM64_UNMAP_KERNEL_AT_EL0
.if \el == 0
@@ -91,6 +92,7 @@ alternative_else_nop_endif
sub sp, sp, #S_FRAME_SIZE
b el\()\el\()_\label
.org .Lventry_start\@ + 128 // Did we overflow the ventry slot?
.endm
.macro tramp_alias, dst, sym
@@ -1122,6 +1124,7 @@ __ni_sys_trace:
add x30, x30, #(1b - tramp_vectors)
isb
ret
.org 1b + 128 // Did we overflow the ventry slot?
.endm
.macro tramp_exit, regsize = 64