svn commit: r303192 - stable/11/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Fri Jul 22 17:22:39 UTC 2016
Author: kib
Date: Fri Jul 22 17:22:37 2016
New Revision: 303192
URL: https://svnweb.freebsd.org/changeset/base/303192
Log:
MFC r302893:
Do not allow creation of char or block special nodes with VNOVAL dev_t.
Approved by: re (gjb)
Modified:
stable/11/sys/kern/vfs_syscalls.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/11/sys/kern/vfs_syscalls.c Fri Jul 22 16:48:39 2016 (r303191)
+++ stable/11/sys/kern/vfs_syscalls.c Fri Jul 22 17:22:37 2016 (r303192)
@@ -1167,6 +1167,8 @@ kern_mknodat(struct thread *td, int fd,
case S_IFCHR:
case S_IFBLK:
error = priv_check(td, PRIV_VFS_MKNOD_DEV);
+ if (error == 0 && dev == VNOVAL)
+ error = EINVAL;
break;
case S_IFMT:
error = priv_check(td, PRIV_VFS_MKNOD_BAD);
More information about the svn-src-all
mailing list