vmspace_fork(): do not override offset for the guard entries

The offset field contains protection for the stack guards.

Reported by:	cy
Fixes:	21e45c30c3
MFC after:	1 week
This commit is contained in:
Konstantin Belousov
2023-07-20 20:45:01 +03:00
parent a29916a6f8
commit db6c7c7f8d
+2 -1
View File
@@ -4181,7 +4181,8 @@ vm_map_copy_entry(
src_entry->start);
} else {
dst_entry->object.vm_object = NULL;
dst_entry->offset = 0;
if ((dst_entry->eflags & MAP_ENTRY_GUARD) == 0)
dst_entry->offset = 0;
if (src_entry->cred != NULL) {
dst_entry->cred = curthread->td_ucred;
crhold(dst_entry->cred);