diff options
author | 2018-07-07 15:40:02 +0000 | |
---|---|---|
committer | 2018-07-07 15:40:02 +0000 | |
commit | e544dc84c509ec01b828be9ea4f25ad0658aa3ff (patch) | |
tree | a1f89b6f11cbce85e469ad023fa0487c1ab43861 /sys/kern/spec_vnops.c | |
parent | Release the kernel lock fully on thread exit. This prevents a locking (diff) | |
download | wireguard-openbsd-e544dc84c509ec01b828be9ea4f25ad0658aa3ff.tar.xz wireguard-openbsd-e544dc84c509ec01b828be9ea4f25ad0658aa3ff.zip |
Fix a locking error in spec_setattr(). Unlike many VOP operations,
VOP_SETATTR() does not release the vnode lock (and it has never done
the unlocking in the past). Therefore spec_setattr() has to keep the
argument vnode locked and unlock v_specparent instead after the nested
VOP_SETATTR() call.
Fixes a WITNESS panic found by anton@
OK anton@, mpi@
Diffstat (limited to 'sys/kern/spec_vnops.c')
-rw-r--r-- | sys/kern/spec_vnops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c index 6a5fdd4b559..7ab06b71476 100644 --- a/sys/kern/spec_vnops.c +++ b/sys/kern/spec_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spec_vnops.c,v 1.93 2018/07/02 20:56:22 bluhm Exp $ */ +/* $OpenBSD: spec_vnops.c,v 1.94 2018/07/07 15:40:02 visa Exp $ */ /* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */ /* @@ -581,7 +581,7 @@ spec_setattr(void *v) vn_lock(vp->v_specparent, LK_EXCLUSIVE|LK_RETRY); error = VOP_SETATTR(vp->v_specparent, ap->a_vap, ap->a_cred, p); - VOP_UNLOCK(vp); + VOP_UNLOCK(vp->v_specparent); return (error); } |