git: 46d35d415aa9 - main - fork: Copy the vm_stacktop field into the new vmspace

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 18 Jan 2022 15:53:12 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=46d35d415aa9664b0ddc98a76e453eec20af0016

commit 46d35d415aa9664b0ddc98a76e453eec20af0016
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-01-18 15:42:21 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-01-18 15:51:49 +0000

    fork: Copy the vm_stacktop field into the new vmspace
    
    Fixes:  1811c1e957ee ("exec: Reimplement stack address randomization")
    Reported by:    pho
    Reported by:    syzbot+0446312a51bc13ead834@syzkaller.appspotmail.com
    Sponsored by:   The FreeBSD Foundation
---
 sys/vm/vm_map.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 98d3d1e5bb1d..8d654f5ac612 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -4263,6 +4263,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_charge)
 	vm2->vm_taddr = vm1->vm_taddr;
 	vm2->vm_daddr = vm1->vm_daddr;
 	vm2->vm_maxsaddr = vm1->vm_maxsaddr;
+	vm2->vm_stacktop = vm1->vm_stacktop;
 	vm_map_lock(old_map);
 	if (old_map->busy)
 		vm_map_wait_busy(old_map);