summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2016-07-12 20:53:04 +0000
committermillert <millert@openbsd.org>2016-07-12 20:53:04 +0000
commitaf6e7e676d78fe5bfc2de55f9855af03ae424149 (patch)
tree4f4110330863764919067915f455a5ab1f3a73ab
parentTurn ahci(4) glue code for the i.MX6 platform into its own imxahci(4) driver (diff)
downloadwireguard-openbsd-af6e7e676d78fe5bfc2de55f9855af03ae424149.tar.xz
wireguard-openbsd-af6e7e676d78fe5bfc2de55f9855af03ae424149.zip
The only valid flag for unmount(2) is MNT_FORCE, ignore any others.
Fixes a crash when MNT_DOOMED is passed in the flags to unmount(2) found by NCC Group. OK bluhm@
-rw-r--r--sys/kern/vfs_syscalls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 1b01622dbac..0bb23b084a0 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.261 2016/07/06 19:26:35 millert Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.262 2016/07/12 20:53:04 millert Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -412,7 +412,7 @@ sys_unmount(struct proc *p, void *v, register_t *retval)
if (vfs_busy(mp, VB_WRITE|VB_WAIT))
return (EBUSY);
- return (dounmount(mp, SCARG(uap, flags), p, vp));
+ return (dounmount(mp, SCARG(uap, flags) & MNT_FORCE, p, vp));
}
/*