Commit 6b47a825 authored by Will Deacon's avatar Will Deacon Committed by Greg Kroah-Hartman
Browse files

arm64: entry: Apply BP hardening for high-priority synchronous exceptions

Commit 5dfc6ed2


Software-step and PC alignment fault exceptions have higher priority than
instruction abort exceptions, so apply the BP hardening hooks there too
if the user PC appears to reside in kernel space.
Reported-by: default avatarDan Hettena <>
Reviewed-by: default avatarMarc Zyngier <>
Signed-off-by: default avatarWill Deacon <>
Signed-off-by: default avatarCatalin Marinas <>
Signed-off-by: default avatarArd Biesheuvel <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent aab33067
......@@ -759,8 +759,10 @@ el0_sp_pc:
* Stack or PC alignment exception handling
mrs x26, far_el1
// enable interrupts before calling the main handler
bl trace_hardirqs_off
mov x0, x26
mov x1, x25
......@@ -778,6 +778,12 @@ asmlinkage void __exception do_sp_pc_abort(unsigned long addr,
struct siginfo info;
struct task_struct *tsk = current;
if (user_mode(regs)) {
if (instruction_pointer(regs) > TASK_SIZE)
if (show_unhandled_signals && unhandled_signal(tsk, SIGBUS))
pr_info_ratelimited("%s[%d]: %s exception: pc=%p sp=%p\n",
tsk->comm, task_pid_nr(tsk),
......@@ -837,6 +843,9 @@ asmlinkage int __exception do_debug_exception(unsigned long addr,
if (interrupts_enabled(regs))
if (user_mode(regs) && instruction_pointer(regs) > TASK_SIZE)
if (!inf->fn(addr, esr, regs)) {
rv = 1;
} else {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment