summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthib <thib@openbsd.org>2007-08-30 12:35:27 +0000
committerthib <thib@openbsd.org>2007-08-30 12:35:27 +0000
commit947ccd731d8456176869a31fa376439b96e3065a (patch)
treed4781c80147fe4549b738f22f1d8106322dea2a7
parentregress test address ranges (diff)
downloadwireguard-openbsd-947ccd731d8456176869a31fa376439b96e3065a.tar.xz
wireguard-openbsd-947ccd731d8456176869a31fa376439b96e3065a.zip
Fix lock ordering problems when updating mount points, in some
cases we could end up releasing an unlocked lock. fixes pr's 5534 and 5564, confirmed by submitters. thanks!. ok art@
-rw-r--r--sys/kern/vfs_syscalls.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 19706a0c923..0dd0099c80d 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.141 2007/08/06 16:58:26 millert Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.142 2007/08/30 12:35:27 thib Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -158,7 +158,6 @@ sys_mount(struct proc *p, void *v, register_t *retval)
vput(vp);
return (error);
}
- VOP_UNLOCK(vp, 0, p);
mp->mnt_flag |= SCARG(uap, flags) & (MNT_RELOAD | MNT_UPDATE);
goto update;
}
@@ -269,7 +268,7 @@ update:
mp->mnt_stat.f_ctime = time_second;
}
if (mp->mnt_flag & MNT_UPDATE) {
- vrele(vp);
+ vput(vp);
if (mp->mnt_flag & MNT_WANTRDWR)
mp->mnt_flag &= ~MNT_RDONLY;
mp->mnt_flag &=~