-; $OpenBSD: syscalls.master,v 1.243 2023/02/14 08:34:49 mvs Exp $
+; $OpenBSD: syscalls.master,v 1.244 2023/02/16 04:42:06 deraadt Exp $
; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
143 STD { int sys_setthrname(pid_t tid, const char *name); }
144 OBSOL ogetrlimit
145 OBSOL osetrlimit
-146 OBSOL okillpg
+146 STD NOLOCK { int sys_pinsyscall(int syscall, void *addr, size_t len); }
147 STD { int sys_setsid(void); }
148 STD { int sys_quotactl(const char *path, int cmd, \
int uid, char *arg); }
-/* $OpenBSD: uvm_extern.h,v 1.166 2022/11/17 18:53:05 deraadt Exp $ */
+/* $OpenBSD: uvm_extern.h,v 1.167 2023/02/16 04:42:07 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.178 2023/02/11 23:22:19 deraadt Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.179 2023/02/16 04:42:08 deraadt Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
#include <machine/exec.h> /* for __LDPGSZ */
+#include <sys/syscall.h>
#include <sys/syscallargs.h>
#include <uvm/uvm.h>
return uvm_map_syscall(&p->p_vmspace->vm_map, addr, addr+size);
}
+/*
+ * sys_pinsyscall
+ */
+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);
+}
+
/*
* sys_mimmutable: the mimmutable system call
*/