diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2023-02-11 23:22:20 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2023-02-11 23:22:20 +0000 |
commit | 85edfdace8f71469e7e46284a84c867b8127f224 (patch) | |
tree | ff72c4ee53fa5ae5bfb67536c9520b6404b0c9fe | |
parent | f072ca6309f10a480e607ccee6175a5bf7906ec6 (diff) |
non-padded 64-bit system calls arrived 2021/12/23, over a year ago.
time to delete the backwards compat padded functions in the kernel.
-rw-r--r-- | sys/kern/kern_pledge.c | 14 | ||||
-rw-r--r-- | sys/kern/syscalls.master | 31 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 94 | ||||
-rw-r--r-- | sys/uvm/uvm_mmap.c | 34 |
4 files changed, 13 insertions, 160 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 09d600f47ba..e5a8a4dd421 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.302 2023/01/07 05:24:58 guenther Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.303 2023/02/11 23:22:17 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -174,18 +174,6 @@ const uint64_t pledge_syscalls[SYS_MAXSYSCALL] = { [SYS_lseek] = PLEDGE_STDIO, [SYS_fpathconf] = PLEDGE_STDIO, -#if 1 - [SYS_pad_mquery] = PLEDGE_STDIO, - [SYS_pad_mmap] = PLEDGE_STDIO, - [SYS_pad_pread] = PLEDGE_STDIO, - [SYS_pad_preadv] = PLEDGE_STDIO, - [SYS_pad_pwrite] = PLEDGE_STDIO, - [SYS_pad_pwritev] = PLEDGE_STDIO, - [SYS_pad_ftruncate] = PLEDGE_STDIO, - [SYS_pad_lseek] = PLEDGE_STDIO, - [SYS_pad_truncate] = PLEDGE_WPATH, -#endif - /* * Address selection required a network pledge ("inet", * "unix", "dns". diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 4bb0a8c905b..6da9a113f09 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -1,4 +1,4 @@ -; $OpenBSD: syscalls.master,v 1.240 2023/02/11 23:07:25 deraadt Exp $ +; $OpenBSD: syscalls.master,v 1.241 2023/02/11 23:21:22 deraadt Exp $ ; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -328,10 +328,8 @@ 172 STD NOLOCK { ssize_t sys_pwritev(int fd, \ const struct iovec *iovp, int iovcnt, \ off_t offset); } -173 STD NOLOCK { ssize_t sys_pad_pread(int fd, void *buf, \ - size_t nbyte, int pad, off_t offset); } -174 STD NOLOCK { ssize_t sys_pad_pwrite(int fd, const void *buf, \ - size_t nbyte, int pad, off_t offset); } +173 OBSOL pad_pread +174 OBSOL pad_pwrite 175 UNIMPL ntp_gettime 176 UNIMPL ntp_adjtime 177 UNIMPL @@ -358,14 +356,11 @@ 195 STD NOLOCK { int sys_setrlimit(int which, \ const struct rlimit *rlp); } 196 OBSOL ogetdirentries48 -197 STD { void *sys_pad_mmap(void *addr, size_t len, int prot, \ - int flags, int fd, long pad, off_t pos); } +197 OBSOL pad_mmap 198 OBSOL __syscall -199 STD NOLOCK { off_t sys_pad_lseek(int fd, int pad, off_t offset, \ - int whence); } -200 STD { int sys_pad_truncate(const char *path, int pad, \ - off_t length); } -201 STD { int sys_pad_ftruncate(int fd, int pad, off_t length); } +199 OBSOL pad_lseek +200 OBSOL pad_truncate +201 OBSOL pad_ftruncate 202 STD { int sys_sysctl(const int *name, u_int namelen, \ void *old, size_t *oldlenp, void *new, \ size_t newlen); } @@ -464,12 +459,8 @@ 264 STD { int sys_fhopen(const fhandle_t *fhp, int flags); } 265 UNIMPL 266 UNIMPL -267 STD NOLOCK { ssize_t sys_pad_preadv(int fd, \ - const struct iovec *iovp, int iovcnt, \ - int pad, off_t offset); } -268 STD NOLOCK { ssize_t sys_pad_pwritev(int fd, \ - const struct iovec *iovp, int iovcnt, \ - int pad, off_t offset); } +267 OBSOL pad_preadv +268 OBSOL pad_pwritev 269 STD NOLOCK { int sys_kqueue(void); } 270 OBSOL t32_kevent 271 STD { int sys_mlockall(int flags); } @@ -491,9 +482,7 @@ 284 STD { int sys_setresgid(gid_t rgid, gid_t egid, \ gid_t sgid); } 285 OBSOL sys_omquery -286 STD { void *sys_pad_mquery(void *addr, size_t len, \ - int prot, int flags, int fd, long pad, \ - off_t pos); } +286 OBSOL pad_mquery 287 STD NOLOCK { int sys_closefrom(int fd); } 288 STD { int sys_sigaltstack(const struct sigaltstack *nss, \ struct sigaltstack *oss); } diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 897773c9a7e..f47f9dfcb69 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.360 2022/08/14 01:58:28 jsg Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.361 2023/02/11 23:22:17 deraadt Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -1932,20 +1932,6 @@ sys_lseek(struct proc *p, void *v, register_t *retval) return (error); } -#if 1 -int -sys_pad_lseek(struct proc *p, void *v, register_t *retval) -{ - struct sys_pad_lseek_args *uap = v; - struct sys_lseek_args unpad; - - SCARG(&unpad, fd) = SCARG(uap, fd); - SCARG(&unpad, offset) = SCARG(uap, offset); - SCARG(&unpad, whence) = SCARG(uap, whence); - return sys_lseek(p, &unpad, retval); -} -#endif - /* * Check access permissions. */ @@ -2891,30 +2877,6 @@ bad: return (error); } -#if 1 -int -sys_pad_truncate(struct proc *p, void *v, register_t *retval) -{ - struct sys_pad_truncate_args *uap = v; - struct sys_truncate_args unpad; - - SCARG(&unpad, path) = SCARG(uap, path); - SCARG(&unpad, length) = SCARG(uap, length); - return sys_truncate(p, &unpad, retval); -} - -int -sys_pad_ftruncate(struct proc *p, void *v, register_t *retval) -{ - struct sys_pad_ftruncate_args *uap = v; - struct sys_ftruncate_args unpad; - - SCARG(&unpad, fd) = SCARG(uap, fd); - SCARG(&unpad, length) = SCARG(uap, length); - return sys_ftruncate(p, &unpad, retval); -} -#endif - /* * Sync an open file. */ @@ -3397,57 +3359,3 @@ sys_pwritev(struct proc *p, void *v, register_t *retval) iovec_free(iov, iovcnt); return (error); } - -#if 1 -int -sys_pad_pread(struct proc *p, void *v, register_t *retval) -{ - struct sys_pad_pread_args *uap = v; - struct sys_pread_args unpad; - - SCARG(&unpad, fd) = SCARG(uap, fd); - SCARG(&unpad, buf) = SCARG(uap, buf); - SCARG(&unpad, nbyte) = SCARG(uap, nbyte); - SCARG(&unpad, offset) = SCARG(uap, offset); - return sys_pread(p, &unpad, retval); -} - -int -sys_pad_preadv(struct proc *p, void *v, register_t *retval) -{ - struct sys_pad_preadv_args *uap = v; - struct sys_preadv_args unpad; - - SCARG(&unpad, fd) = SCARG(uap, fd); - SCARG(&unpad, iovp) = SCARG(uap, iovp); - SCARG(&unpad, iovcnt) = SCARG(uap, iovcnt); - SCARG(&unpad, offset) = SCARG(uap, offset); - return sys_preadv(p, &unpad, retval); -} - -int -sys_pad_pwrite(struct proc *p, void *v, register_t *retval) -{ - struct sys_pad_pwrite_args *uap = v; - struct sys_pwrite_args unpad; - - SCARG(&unpad, fd) = SCARG(uap, fd); - SCARG(&unpad, buf) = SCARG(uap, buf); - SCARG(&unpad, nbyte) = SCARG(uap, nbyte); - SCARG(&unpad, offset) = SCARG(uap, offset); - return sys_pwrite(p, &unpad, retval); -} - -int -sys_pad_pwritev(struct proc *p, void *v, register_t *retval) -{ - struct sys_pad_pwritev_args *uap = v; - struct sys_pwritev_args unpad; - - SCARG(&unpad, fd) = SCARG(uap, fd); - SCARG(&unpad, iovp) = SCARG(uap, iovp); - SCARG(&unpad, iovcnt) = SCARG(uap, iovcnt); - SCARG(&unpad, offset) = SCARG(uap, offset); - return sys_pwritev(p, &unpad, retval); -} -#endif diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c index 1ebed4cb1b6..e3dcd41089e 100644 --- a/sys/uvm/uvm_mmap.c +++ b/sys/uvm/uvm_mmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_mmap.c,v 1.177 2023/01/16 07:09:11 guenther Exp $ */ +/* $OpenBSD: uvm_mmap.c,v 1.178 2023/02/11 23:22:19 deraadt Exp $ */ /* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */ /* @@ -434,38 +434,6 @@ out: return error; } -#if 1 -int -sys_pad_mquery(struct proc *p, void *v, register_t *retval) -{ - struct sys_pad_mquery_args *uap = v; - struct sys_mquery_args unpad; - - SCARG(&unpad, addr) = SCARG(uap, addr); - SCARG(&unpad, len) = SCARG(uap, len); - SCARG(&unpad, prot) = SCARG(uap, prot); - SCARG(&unpad, flags) = SCARG(uap, flags); - SCARG(&unpad, fd) = SCARG(uap, fd); - SCARG(&unpad, pos) = SCARG(uap, pos); - return sys_mquery(p, &unpad, retval); -} - -int -sys_pad_mmap(struct proc *p, void *v, register_t *retval) -{ - struct sys_pad_mmap_args *uap = v; - struct sys_mmap_args unpad; - - SCARG(&unpad, addr) = SCARG(uap, addr); - SCARG(&unpad, len) = SCARG(uap, len); - SCARG(&unpad, prot) = SCARG(uap, prot); - SCARG(&unpad, flags) = SCARG(uap, flags); - SCARG(&unpad, fd) = SCARG(uap, fd); - SCARG(&unpad, pos) = SCARG(uap, pos); - return sys_mmap(p, &unpad, retval); -} -#endif - /* * sys_msync: the msync system call (a front-end for flush) */ |