Skip to content

Commit

Permalink
arm64: entry.S: Add ventry overflow sanity checks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
James Morse committed Feb 15, 2022
1 parent dfd42fa commit 4330e2c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

.macro kernel_ventry, el:req, ht:req, regsize:req, label:req
.align 7
.Lventry_start\@:
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
.if \el == 0
alternative_if ARM64_UNMAP_KERNEL_AT_EL0
Expand Down Expand Up @@ -95,6 +96,7 @@ alternative_else_nop_endif
mrs x0, tpidrro_el0
#endif
b el\el\ht\()_\regsize\()_\label
.org .Lventry_start\@ + 128 // Did we overflow the ventry slot?
.endm

.macro tramp_alias, dst, sym
Expand Down Expand Up @@ -662,6 +664,7 @@ alternative_else_nop_endif
add x30, x30, #(1b - tramp_vectors)
isb
ret
.org 1b + 128 // Did we overflow the ventry slot?
.endm

.macro tramp_exit, regsize = 64
Expand Down

0 comments on commit 4330e2c

Please sign in to comment.