Hi, I have found more unveil functions that are used in separate C files. They should have common prototypes in the namei.h header. It is #ifdef _KERNEL and survived a make build.
ok? bluhm Index: kern/kern_unveil.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/kern/kern_unveil.c,v retrieving revision 1.30 diff -u -p -r1.30 kern_unveil.c --- kern/kern_unveil.c 1 Aug 2019 15:09:25 -0000 1.30 +++ kern/kern_unveil.c 1 Aug 2019 16:55:14 -0000 @@ -43,9 +43,6 @@ #define UNVEIL_MAX_VNODES 128 #define UNVEIL_MAX_NAMES 128 -struct unveil *unveil_lookup(struct vnode *vp, struct proc *p, - ssize_t *position); - static inline int unvname_compare(const struct unvname *n1, const struct unvname *n2) { Index: kern/vfs_syscalls.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/kern/vfs_syscalls.c,v retrieving revision 1.327 diff -u -p -r1.327 vfs_syscalls.c --- kern/vfs_syscalls.c 25 Jul 2019 01:43:21 -0000 1.327 +++ kern/vfs_syscalls.c 1 Aug 2019 16:53:35 -0000 @@ -90,11 +90,6 @@ int doutimensat(struct proc *, int, cons int dovutimens(struct proc *, struct vnode *, struct timespec [2]); int dofutimens(struct proc *, int, struct timespec [2]); int dounmount_leaf(struct mount *, int, struct proc *); -int unveil_add(struct proc *, struct nameidata *, const char *); -void unveil_removevnode(struct vnode *vp); -void unveil_free_traversed_vnodes(struct nameidata *); -ssize_t unveil_find_cover(struct vnode *, struct proc *); -struct unveil *unveil_lookup(struct vnode *, struct proc *, ssize_t *); /* * Virtual File System System Calls Index: sys/namei.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/sys/namei.h,v retrieving revision 1.41 diff -u -p -r1.41 namei.h --- sys/namei.h 27 Jul 2019 21:15:36 -0000 1.41 +++ sys/namei.h 1 Aug 2019 16:55:35 -0000 @@ -204,6 +204,11 @@ void nchinit(void); struct mount; void cache_purgevfs(struct mount *); +int unveil_add(struct proc *, struct nameidata *, const char *); +void unveil_removevnode(struct vnode *); +void unveil_free_traversed_vnodes(struct nameidata *); +ssize_t unveil_find_cover(struct vnode *, struct proc *); +struct unveil *unveil_lookup(struct vnode *, struct proc *, ssize_t *); void unveil_start_relative(struct proc *, struct nameidata *); void unveil_check_component(struct proc *, struct nameidata *, struct vnode *); int unveil_check_final(struct proc *, struct nameidata *);