From fa1720442ff60eb2601551424c2ea49e9b66d416 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 20 Jul 2022 05:56:34 +0000 Subject: [PATCH] the _pad_ system calls from 2021/12/23 can go away ok guenther --- sys/arch/hppa/hppa/trap.c | 13 +----- sys/kern/kern_ktrace.c | 6 +-- sys/kern/vfs_syscalls.c | 94 +-------------------------------------- sys/uvm/uvm_mmap.c | 34 +------------- usr.bin/kdump/kdump.c | 22 +-------- 5 files changed, 5 insertions(+), 164 deletions(-) diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index b052fa12904..36827bc23a8 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.156 2021/12/23 18:50:32 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.157 2022/07/20 05:56:34 deraadt Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -849,17 +849,6 @@ syscall(struct trapframe *frame) case SYS_pwrite: i = 4; break; case SYS_mquery: case SYS_mmap: i = 6; break; -#ifdef SYS_pad_lseek - case SYS_pad_lseek: retq = 0; - case SYS_pad_truncate: - case SYS_pad_ftruncate: i = 2; break; - case SYS_pad_preadv: - case SYS_pad_pwritev: - case SYS_pad_pread: - case SYS_pad_pwrite: i = 4; break; - case SYS_pad_mquery: - case SYS_pad_mmap: i = 6; break; -#endif } if (i) { diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index e8810fb0264..fa8e6bf4d21 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_ktrace.c,v 1.106 2022/02/22 17:14:14 deraadt Exp $ */ +/* $OpenBSD: kern_ktrace.c,v 1.107 2022/07/20 05:56:36 deraadt Exp $ */ /* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */ /* @@ -204,10 +204,6 @@ ktrsysret(struct proc *p, register_t code, int error, else if (code == SYS_lseek) /* the one exception: lseek on ILP32 needs more */ len = sizeof(long long); -#if 1 - else if (code == SYS_pad_lseek) - len = sizeof(long long); -#endif else len = sizeof(register_t); ktrwrite2(p, &kth, &ktp, sizeof(ktp), retval, len); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 4a8e37afb4c..c69e513ddd6 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.357 2022/05/23 15:17:11 millert Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.358 2022/07/20 05:56:36 deraadt Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -1936,20 +1936,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. */ @@ -2895,30 +2881,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. */ @@ -3401,57 +3363,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 d44941a5e95..e1c318b8375 100644 --- a/sys/uvm/uvm_mmap.c +++ b/sys/uvm/uvm_mmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_mmap.c,v 1.170 2022/06/27 14:26:06 cheloha Exp $ */ +/* $OpenBSD: uvm_mmap.c,v 1.171 2022/07/20 05:56:36 deraadt Exp $ */ /* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */ /* @@ -439,38 +439,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) */ diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 5a0048abd9c..ef6bb1126bc 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kdump.c,v 1.148 2022/02/22 17:31:31 deraadt Exp $ */ +/* $OpenBSD: kdump.c,v 1.149 2022/07/20 05:56:36 deraadt Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -818,10 +818,6 @@ static const formatter scargs[][8] = { [SYS_sysarch] = { Pdecint, Pptr }, [SYS_pread] = { Pfd, Pptr, Pbigsize, Poff_t, END64 }, [SYS_pwrite] = { Pfd, Pptr, Pbigsize, Poff_t, END64 }, -#ifdef SYS_pad_pread - [SYS_pad_pread] = { Pfd, Pptr, Pbigsize, PAD, Poff_t }, - [SYS_pad_pwrite] = { Pfd, Pptr, Pbigsize, PAD, Poff_t }, -#endif [SYS_setgid] = { Gidname }, [SYS_setegid] = { Gidname }, [SYS_seteuid] = { Uidname }, @@ -834,12 +830,6 @@ static const formatter scargs[][8] = { [SYS_lseek] = { Pfd, Poff_t, Whencename, END64 }, [SYS_truncate] = { Ppath, Poff_t, END64 }, [SYS_ftruncate] = { Pfd, Poff_t, END64 }, -#ifdef SYS_pad_mmap - [SYS_pad_mmap] = { Pptr, Pbigsize, Mmapprotname, Mmapflagsname, Pfd, PAD, Poff_t }, - [SYS_pad_lseek] = { Pfd, PAD, Poff_t, Whencename }, - [SYS_pad_truncate] = { Ppath, PAD, Poff_t }, - [SYS_pad_ftruncate] = { Pfd, PAD, Poff_t }, -#endif [SYS_sysctl] = { Pptr, Pcount, Pptr, Pptr, Pptr, Psize }, [SYS_mlock] = { Pptr, Pbigsize }, [SYS_munlock] = { Pptr, Pbigsize }, @@ -860,19 +850,12 @@ static const formatter scargs[][8] = { [SYS_fhopen] = { Pptr, Openflagsname }, [SYS_preadv] = { Pfd, Pptr, Pcount, Poff_t, END64 }, [SYS_pwritev] = { Pfd, Pptr, Pcount, Poff_t, END64 }, -#ifdef SYS_pad_preadv - [SYS_pad_preadv] = { Pfd, Pptr, Pcount, PAD, Poff_t }, - [SYS_pad_pwritev] = { Pfd, Pptr, Pcount, PAD, Poff_t }, -#endif [SYS_mlockall] = { Mlockallname }, [SYS_getresuid] = { Pptr, Pptr, Pptr }, [SYS_setresuid] = { Uidname, Uidname, Uidname }, [SYS_getresgid] = { Pptr, Pptr, Pptr }, [SYS_setresgid] = { Gidname, Gidname, Gidname }, [SYS_mquery] = { Pptr, Pbigsize, Mmapprotname, Mmapflagsname, Pfd, Poff_t, END64 }, -#ifdef SYS_pad_mquery - [SYS_pad_mquery] = { Pptr, Pbigsize, Mmapprotname, Mmapflagsname, Pfd, PAD, Poff_t }, -#endif [SYS_closefrom] = { Pfd }, [SYS_sigaltstack] = { Pptr, Pptr }, [SYS_shmget] = { Pkey_t, Pbigsize, Semgetname }, @@ -1145,9 +1128,6 @@ doerr: if (fancy) { switch (code) { case SYS_lseek: -#ifdef SYS_pad_lseek - case SYS_pad_lseek: -#endif (void)printf("%lld", retll); if (retll < 0 || retll > 9) (void)printf("/%#llx", retll); -- 2.20.1