mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 21:45:45 +02:00
UPSTREAM: 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.
Bug: 215557547
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I03d4525ca81ff83c726a9a43258604b9e165fadc
This commit is contained in:
parent
81ec26aafe
commit
17867c11a2
|
|
@ -62,6 +62,7 @@
|
||||||
|
|
||||||
.macro kernel_ventry, el, label, regsize = 64
|
.macro kernel_ventry, el, label, regsize = 64
|
||||||
.align 7
|
.align 7
|
||||||
|
.Lventry_start\@:
|
||||||
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
|
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
|
||||||
.if \el == 0
|
.if \el == 0
|
||||||
alternative_if ARM64_UNMAP_KERNEL_AT_EL0
|
alternative_if ARM64_UNMAP_KERNEL_AT_EL0
|
||||||
|
|
@ -120,6 +121,7 @@ alternative_else_nop_endif
|
||||||
mrs x0, tpidrro_el0
|
mrs x0, tpidrro_el0
|
||||||
#endif
|
#endif
|
||||||
b el\()\el\()_\label
|
b el\()\el\()_\label
|
||||||
|
.org .Lventry_start\@ + 128 // Did we overflow the ventry slot?
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro tramp_alias, dst, sym
|
.macro tramp_alias, dst, sym
|
||||||
|
|
@ -929,6 +931,7 @@ alternative_else_nop_endif
|
||||||
add x30, x30, #(1b - tramp_vectors)
|
add x30, x30, #(1b - tramp_vectors)
|
||||||
isb
|
isb
|
||||||
ret
|
ret
|
||||||
|
.org 1b + 128 // Did we overflow the ventry slot?
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro tramp_exit, regsize = 64
|
.macro tramp_exit, regsize = 64
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user