amd64: clear debug registers on execing 32bit Linux binary

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D29687
This commit is contained in:
Konstantin Belousov 2021-04-10 02:25:06 +03:00
parent d50adfec9e
commit 94172affa4
1 changed files with 2 additions and 0 deletions

View File

@ -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 */