summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-11-27 01:04:13 +0000
committerderaadt <deraadt@openbsd.org>2019-11-27 01:04:13 +0000
commit43981c5226a00cb8b9ea74db0c340b73dbde2350 (patch)
tree3e9e80b20cdcdfc23894a076d945d9395dff3085
parentunifdef: hppa does HAVE_JMPREL and does not have DT_PROCNUM (diff)
downloadwireguard-openbsd-43981c5226a00cb8b9ea74db0c340b73dbde2350.tar.xz
wireguard-openbsd-43981c5226a00cb8b9ea74db0c340b73dbde2350.zip
Add dummy msyscall(2) system call which is currently a noop. This will
be used by kernel and ld.so in the near future. Adding the system call earlier will reduce the number of people who try to build through and encounter agony. ok kettenis guenther
-rw-r--r--sys/kern/syscalls.master4
-rw-r--r--sys/uvm/uvm_mmap.c28
2 files changed, 29 insertions, 3 deletions
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 29b12d1e868..13b44d159b9 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1,4 +1,4 @@
-; $OpenBSD: syscalls.master,v 1.197 2019/08/13 07:09:21 anton Exp $
+; $OpenBSD: syscalls.master,v 1.198 2019/11/27 01:04:13 deraadt Exp $
; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -105,7 +105,7 @@
34 STD { int sys_chflags(const char *path, u_int flags); }
35 STD { int sys_fchflags(int fd, u_int flags); }
36 STD { void sys_sync(void); }
-37 OBSOL o58_kill
+37 STD { int sys_msyscall(void *addr, size_t len); }
38 STD { int sys_stat(const char *path, struct stat *ub); }
39 STD { pid_t sys_getppid(void); }
40 STD { int sys_lstat(const char *path, struct stat *ub); }
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 9f1a6bd9197..900ab65f39d 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_mmap.c,v 1.157 2019/06/21 09:39:49 visa Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.158 2019/11/27 01:04:13 deraadt Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -584,6 +584,32 @@ sys_mprotect(struct proc *p, void *v, register_t *retval)
}
/*
+ * sys_msyscall: the msyscall system call
+ */
+int
+sys_msyscall(struct proc *p, void *v, register_t *retval)
+{
+ struct sys_msyscall_args /* {
+ syscallarg(void *) addr;
+ syscallarg(size_t) len;
+ } */ *uap = v;
+ vaddr_t addr;
+ vsize_t size, pageoff;
+
+ addr = (vaddr_t)SCARG(uap, addr);
+ size = (vsize_t)SCARG(uap, len);
+
+ /*
+ * align the address to a page boundary, and adjust the size accordingly
+ */
+ ALIGN_ADDR(addr, size, pageoff);
+ if (addr > SIZE_MAX - size)
+ return (EINVAL); /* disallow wrap-around. */
+
+ return (0);
+}
+
+/*
* sys_minherit: the minherit system call
*/
int