-/* $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>
[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".
-/* $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 $ */
/*
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.
*/
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.
*/
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
-/* $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 $ */
/*
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)
*/