aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-04-09 23:25:06 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-04-23 11:14:08 +0000
commit0d511482557677ef7aecb3109955d1596d5cf9d9 (patch)
treec84c2d1ee50f773d918c07f3059caa98532438d0
parent88d6f049c12f5d6945209c8805d4399a766de524 (diff)
downloadsrc-0d511482557677ef7aecb3109955d1596d5cf9d9.tar.gz
src-0d511482557677ef7aecb3109955d1596d5cf9d9.zip
amd64: clear debug registers on execing 32bit Linux binary
(cherry picked from commit 94172affa43af15fe3b50293a96c292eca30c386)
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index bb86baefaec4..3790d0fcb69c 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -722,6 +722,8 @@ linux_exec_setregs(struct thread *td, struct image_params *imgp,
regs->tf_cs = _ucode32sel;
regs->tf_rbx = (register_t)imgp->ps_strings;
+ x86_clear_dbregs(pcb);
+
fpstate_drop(td);
/* Do full restore on return so that we can change to a different %cs */