git: db6c7c7f8d87 - main - vmspace_fork(): do not override offset for the guard entries
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 20 Jul 2023 19:04:25 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=db6c7c7f8d870f377fcd1cc98e4832681bb5bdf0
commit db6c7c7f8d870f377fcd1cc98e4832681bb5bdf0
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-07-20 17:45:01 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-07-20 19:04:03 +0000
vmspace_fork(): do not override offset for the guard entries
The offset field contains protection for the stack guards.
Reported by: cy
Fixes: 21e45c30c35c9aa732073f725924caf581c93460
MFC after: 1 week
---
sys/vm/vm_map.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 997a49111a59..444e09986d4e 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -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);