aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64
diff options
context:
space:
mode:
authorDmitry Chagin <dchagin@FreeBSD.org>2023-05-14 21:25:57 +0000
committerDmitry Chagin <dchagin@FreeBSD.org>2023-05-14 21:25:57 +0000
commit2cdeb89e57008e9299c1665783359141868f387e (patch)
tree30e52e4b4f6596739e8647f66ad9459413c8608d /sys/arm64
parentbf3a14b41a7bfe8357a4672a8f901cfc887f3862 (diff)
downloadsrc-2cdeb89e57008e9299c1665783359141868f387e.tar.gz
src-2cdeb89e57008e9299c1665783359141868f387e.zip
linux(4): Fix stack unwinding on arm64 [2/2]
To allow unwinders to go througth a previous to sigreturn frame we should properly emulate the trampoline frame record which should points to the previous frame and set the trampoline frame pointer to the emulated frame before calling signal handler. MFC after: 1 week
Diffstat (limited to 'sys/arm64')
-rw-r--r--sys/arm64/linux/linux_sysvec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c
index b2853d8e8359..8337bdfe0eb2 100644
--- a/sys/arm64/linux/linux_sysvec.c
+++ b/sys/arm64/linux/linux_sysvec.c
@@ -301,7 +301,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/* Stack frame for unwinding */
frame->fp = tf->tf_x[29];
- frame->lr = tf->tf_lr;
+ frame->lr = tf->tf_elr;
/* Translate the signal. */
sig = bsd_to_linux_signal(sig);
@@ -352,6 +352,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
tf->tf_x[1] = 0;
tf->tf_x[2] = 0;
}
+ tf->tf_x[29] = (register_t)&fp->fp;
tf->tf_x[8] = (register_t)catcher;
tf->tf_sp = (register_t)fp;
tf->tf_elr = (register_t)linux_vdso_sigcode;