[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/10] exec: Stop relying on address space size
From: |
Sergey Bugaev |
Subject: |
[PATCH 06/10] exec: Stop relying on address space size |
Date: |
Sat, 23 Mar 2024 14:53:18 +0300 |
The code here just wants to deallocate the whole address space, and Mach
already contains the logic to limit the passed-in range to the vm_map's
actual bounds (see VM_MAP_RANGE_CHECK).
---
exec/exec.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/exec/exec.c b/exec/exec.c
index f6788520..ac226f9a 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1219,9 +1219,7 @@ do_exec (file_t file,
munmap ((caddr_t) threads, nthreads * sizeof (thread_t));
/* Deallocate the entire virtual address space of the task. */
-
- vm_deallocate (oldtask,
- VM_MIN_ADDRESS, VM_MAX_ADDRESS - VM_MIN_ADDRESS);
+ vm_deallocate (oldtask, 0, (vm_size_t) -1);
/* Nothing is supposed to go wrong any more. If anything does, the
old task is now in a hopeless state and must be killed. */
--
2.44.0
- [PATCH 01/10] term: Fix function prototype, Sergey Bugaev, 2024/03/23
- [PATCH 02/10] exec: Fix creating executable stacks, Sergey Bugaev, 2024/03/23
- [PATCH 04/10] proc: Only try host_kernel_version () on i386, Sergey Bugaev, 2024/03/23
- [PATCH 05/10] libshouldbeinlibc: Stop relying on address space size, Sergey Bugaev, 2024/03/23
- [PATCH 03/10] Make long & friends 64-bit on 64-bit platforms, Sergey Bugaev, 2024/03/23
- [PATCH 06/10] exec: Stop relying on address space size,
Sergey Bugaev <=
- [PATCH 09/10] proc: Add support for AArch64 in uname, Sergey Bugaev, 2024/03/23
- [PATCH 07/10] exec: Add support for AArch64 executables, Sergey Bugaev, 2024/03/23
- [PATCH 10/10] boot: Add support for AArch64, Sergey Bugaev, 2024/03/23
- [PATCH 08/10] elfcore: Add support for saving AArch64 registers, Sergey Bugaev, 2024/03/23
- Re: [PATCH 01/10] term: Fix function prototype, Samuel Thibault, 2024/03/23