-/* $OpenBSD: uvm_extern.h,v 1.172 2024/01/17 22:22:25 kurt Exp $ */
+/* $OpenBSD: uvm_extern.h,v 1.173 2024/01/19 21:20:35 deraadt Exp $ */
/* $NetBSD: uvm_extern.h,v 1.57 2001/03/09 01:02:12 chs Exp $ */
/*
caddr_t vm_daddr; /* [I] user virtual address of data */
caddr_t vm_maxsaddr; /* [I] user VA at max stack growth */
caddr_t vm_minsaddr; /* [I] user VA at top of stack */
- vaddr_t vm_execve; /* [v] execve systemcall stub region */
- vaddr_t vm_execve_end; /* [v] execve systemcall stub region */
};
/*
-/* $OpenBSD: uvm_mmap.c,v 1.184 2024/01/16 19:05:01 deraadt Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.185 2024/01/19 21:20:35 deraadt Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
int
sys_pinsyscall(struct proc *p, void *v, register_t *retval)
{
- struct sys_pinsyscall_args /* {
- syscallarg(int) syscall;
- syscallarg(void *) addr;
- syscallarg(size_t) len;
- } */ *uap = v;
- struct vmspace *vm = p->p_vmspace;
- vm_map_t map = &p->p_vmspace->vm_map;
- vaddr_t start, end;
-
- if (SCARG(uap, syscall) != SYS_execve)
- return (EINVAL);
- start = (vaddr_t)SCARG(uap, addr);
- end = start + (vsize_t)SCARG(uap, len);
- if (start >= end || start < map->min_offset || end > map->max_offset)
- return (EFAULT);
- vm_map_lock(map);
- if (vm->vm_execve) {
- vm_map_unlock(map);
- return (EPERM);
- }
- vm->vm_execve = start;
- vm->vm_execve_end = end;
- vm_map_unlock(map);
return (0);
}