diff options
author | Mark Johnston <markj@FreeBSD.org> | 2022-03-01 16:52:39 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2022-03-15 15:40:36 +0000 |
commit | 87e1a4346d908b3d4cd1fc93f97968197ab80240 (patch) | |
tree | a54c6308e7956dd0fbc166baab630090986d2bf6 | |
parent | 7c27fee0ea1690445b98e29c12c8939983257c84 (diff) | |
download | src-87e1a4346d908b3d4cd1fc93f97968197ab80240.tar.gz src-87e1a4346d908b3d4cd1fc93f97968197ab80240.zip |
fasttrap: Assert that fasttrap_fork() successfully unmaps scratch space
No functional change intended.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 83958173eb7d3f9d402e6dc81e66d179a808dd63)
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c index 4771a67a9f09..d96d3f44182e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c @@ -588,7 +588,7 @@ fasttrap_fork(proc_t *p, proc_t *cp) fasttrap_proc_t *fprc = NULL; #endif pid_t ppid = p->p_pid; - int i; + int error, i; ASSERT(curproc == p); #ifdef illumos @@ -678,9 +678,10 @@ fasttrap_fork(proc_t *p, proc_t *cp) if (fprc != NULL) { mutex_enter(&fprc->ftpc_mtx); LIST_FOREACH(scrblk, &fprc->ftpc_scrblks, ftsb_next) { - vm_map_remove(&cp->p_vmspace->vm_map, + error = vm_map_remove(&cp->p_vmspace->vm_map, scrblk->ftsb_addr, scrblk->ftsb_addr + FASTTRAP_SCRBLOCK_SIZE); + ASSERT(error == KERN_SUCCESS); } mutex_exit(&fprc->ftpc_mtx); } |