|
@@ -732,6 +732,12 @@ asmlinkage void __exception do_sp_pc_abort(unsigned long addr,
|
|
struct siginfo info;
|
|
struct siginfo info;
|
|
struct task_struct *tsk = current;
|
|
struct task_struct *tsk = current;
|
|
|
|
|
|
|
|
+ if (user_mode(regs)) {
|
|
|
|
+ if (instruction_pointer(regs) > TASK_SIZE)
|
|
|
|
+ arm64_apply_bp_hardening();
|
|
|
|
+ local_irq_enable();
|
|
|
|
+ }
|
|
|
|
+
|
|
if (show_unhandled_signals && unhandled_signal(tsk, SIGBUS))
|
|
if (show_unhandled_signals && unhandled_signal(tsk, SIGBUS))
|
|
pr_info_ratelimited("%s[%d]: %s exception: pc=%p sp=%p\n",
|
|
pr_info_ratelimited("%s[%d]: %s exception: pc=%p sp=%p\n",
|
|
tsk->comm, task_pid_nr(tsk),
|
|
tsk->comm, task_pid_nr(tsk),
|
|
@@ -791,6 +797,9 @@ asmlinkage int __exception do_debug_exception(unsigned long addr,
|
|
if (interrupts_enabled(regs))
|
|
if (interrupts_enabled(regs))
|
|
trace_hardirqs_off();
|
|
trace_hardirqs_off();
|
|
|
|
|
|
|
|
+ if (user_mode(regs) && instruction_pointer(regs) > TASK_SIZE)
|
|
|
|
+ arm64_apply_bp_hardening();
|
|
|
|
+
|
|
if (!inf->fn(addr, esr, regs)) {
|
|
if (!inf->fn(addr, esr, regs)) {
|
|
rv = 1;
|
|
rv = 1;
|
|
} else {
|
|
} else {
|