From 22620b9e9e7760953f3ae0e04859aa8ca22803f0 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 12 Jul 2016 20:53:05 +0000 Subject: 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@ --- sys/kern/vfs_syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys') 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)); } /* -- cgit v1.2.3