From db46ea2eb9dc84959fbf9b1819facac3d6078ba1 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sat, 23 Mar 2024 14:53:18 +0300 Subject: exec: Stop relying on address space size 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). Message-ID: <20240323115322.69075-6-bugaevc@gmail.com> --- exec/exec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'exec') 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. */ -- cgit v1.2.3