diff options
| author | Mitchell Horne <mhorne@FreeBSD.org> | 2021-04-07 19:23:46 +0000 |
|---|---|---|
| committer | Mitchell Horne <mhorne@FreeBSD.org> | 2021-04-08 12:41:41 +0000 |
| commit | 1fd001db9c330f133708f3c04c8852f8b07cfed9 (patch) | |
| tree | 814be085f59d7361e6809a8cf8bcfa2ffeac7785 | |
| parent | 4967f672ef3095300fe74a9d1ae873d0897cc0a5 (diff) | |
| download | src-1fd001db9c330f133708f3c04c8852f8b07cfed9.tar.gz src-1fd001db9c330f133708f3c04c8852f8b07cfed9.zip | |
arm64: clear debug register state on fork
Following the analogous change for amd64 and i386 in 8223717ce62c,
ensure that new processes start with these registers inactive.
PR: 254661
Reported by: Michał Górny
Reviewed by: kib, emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29630
| -rw-r--r-- | sys/arm64/arm64/vm_machdep.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index c37f1d849359..a7b02e98959f 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -91,6 +91,9 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) td2->td_pcb = pcb2; bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); + /* Clear the debug register state. */ + bzero(&pcb2->pcb_dbg_regs, sizeof(pcb2->pcb_dbg_regs)); + tf = (struct trapframe *)STACKALIGN((struct trapframe *)pcb2 - 1); bcopy(td1->td_frame, tf, sizeof(*tf)); tf->tf_x[0] = 0; |
