unmount(2): do not allow MNT_DEFERRED or MNT_RECURSE flags from userspace

Repprted and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov
2026-02-03 00:38:32 +02:00
parent e1f36b9db9
commit cd8d44173a
+2
View File
@@ -1733,6 +1733,8 @@ kern_unmount(struct thread *td, const char *path, int flags)
int error;
AUDIT_ARG_VALUE(flags);
if ((flags & (MNT_DEFERRED | MNT_RECURSE)) != 0)
return (EINVAL);
if (jailed(td->td_ucred) || usermount == 0) {
error = priv_check(td, PRIV_VFS_UNMOUNT);
if (error)