summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-01-14 16:43:47 +0000
committerderaadt <deraadt@openbsd.org>2019-01-14 16:43:47 +0000
commitc1545a49146d5e1416f6ce5b0312b317b88f6ed5 (patch)
treeeaae888fcab0455ce4688dd287b73d0137e15fab
parentPrevent multiple ntpds from tripping over each other. (diff)
downloadwireguard-openbsd-c1545a49146d5e1416f6ce5b0312b317b88f6ed5.tar.xz
wireguard-openbsd-c1545a49146d5e1416f6ce5b0312b317b88f6ed5.zip
backout previous; crashes near mountpoints it seems
-rw-r--r--sys/kern/kern_unveil.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/kern/kern_unveil.c b/sys/kern/kern_unveil.c
index d3e13116aae..39d7eeb36c6 100644
--- a/sys/kern/kern_unveil.c
+++ b/sys/kern/kern_unveil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_unveil.c,v 1.20 2019/01/14 04:02:39 beck Exp $ */
+/* $OpenBSD: kern_unveil.c,v 1.21 2019/01/14 16:43:47 deraadt Exp $ */
/*
* Copyright (c) 2017-2018 Bob Beck <beck@openbsd.org>
@@ -740,11 +740,8 @@ unveil_check_component(struct proc *p, struct nameidata *ni, struct vnode *dp)
/*
* adjust unveil match as necessary
*/
- uv = unveil_covered(ni->ni_unveil_match, dp,
- p->p_p);
- /* clear the match when we DOTDOT above it */
- if (ni->ni_unveil_match->uv_vp == dp)
- ni->ni_unveil_match = NULL;
+ ni->ni_unveil_match = unveil_covered(
+ ni->ni_unveil_match, dp, p->p_p);
}
else
uv = unveil_lookup(dp, p, NULL);
@@ -846,7 +843,7 @@ unveil_check_final(struct proc *p, struct nameidata *ni)
if (uv->uv_flags & UNVEIL_USERSET)
return EACCES;
else
- goto done;
+ return ENOENT;
}
/* directory flags match, update match */
if (uv->uv_flags & UNVEIL_USERSET)