From: kettenis Date: Wed, 26 Apr 2023 12:30:24 +0000 (+0000) Subject: Properly handle userland branch target traps. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cba784659c796710988e1513aae75d7ad57f4b84;p=openbsd Properly handle userland branch target traps. ok deraadt@, patrick@ --- diff --git a/sys/arch/arm64/arm64/trap.c b/sys/arch/arm64/arm64/trap.c index 7f4f37ef4c2..78d1857f383 100644 --- a/sys/arch/arm64/arm64/trap.c +++ b/sys/arch/arm64/arm64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.43 2023/03/27 19:02:47 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.44 2023/04/26 12:30:24 kettenis Exp $ */ /*- * Copyright (c) 2014 Andrew Turner * All rights reserved. @@ -281,6 +281,11 @@ do_el0_sync(struct trapframe *frame) case EXCP_TRAP_FP: fpu_load(p); break; + case EXCP_BRANCH_TGT: + curcpu()->ci_flush_bp(); + sv.sival_ptr = (void *)frame->tf_elr; + trapsignal(p, SIGILL, 0, ILL_ILLOPC, sv); + break; case EXCP_SVC: svc_handler(frame); break;