From owner-svn-src-all@freebsd.org Sun Oct 22 08:11:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFE14E4C623; Sun, 22 Oct 2017 08:11:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF19B820F5; Sun, 22 Oct 2017 08:11:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9M8Bjt9033553; Sun, 22 Oct 2017 08:11:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9M8Bjw5033551; Sun, 22 Oct 2017 08:11:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710220811.v9M8Bjw5033551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 Oct 2017 08:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324853 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Oct 2017 08:11:47 -0000 Author: kib Date: Sun Oct 22 08:11:45 2017 New Revision: 324853 URL: https://svnweb.freebsd.org/changeset/base/324853 Log: Remove the support for mknod(S_IFMT), which created dummy vnodes with VBAD type. FFS ffs_write() VOP catches such vnodes and panics, other VOPs do not check for the type and their behaviour is really undefined. The comment claims that this support was done for 'badsect' to flag bad sectors, we do not have such facility in kernel anyway. Reported by: Dmitry Vyukov Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_syscalls.c head/sys/sys/priv.h Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sun Oct 22 07:58:28 2017 (r324852) +++ head/sys/kern/vfs_syscalls.c Sun Oct 22 08:11:45 2017 (r324853) @@ -1248,9 +1248,6 @@ kern_mknodat(struct thread *td, int fd, char *path, en if (error == 0 && dev == VNOVAL) error = EINVAL; break; - case S_IFMT: - error = priv_check(td, PRIV_VFS_MKNOD_BAD); - break; case S_IFWHT: error = priv_check(td, PRIV_VFS_MKNOD_WHT); break; @@ -1288,9 +1285,6 @@ restart: whiteout = 0; switch (mode & S_IFMT) { - case S_IFMT: /* used by badsect to flag bad sectors */ - vattr.va_type = VBAD; - break; case S_IFCHR: vattr.va_type = VCHR; break; Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Sun Oct 22 07:58:28 2017 (r324852) +++ head/sys/sys/priv.h Sun Oct 22 08:11:45 2017 (r324853) @@ -266,7 +266,7 @@ #define PRIV_VFS_GETFH 327 /* Can retrieve file handles. */ #define PRIV_VFS_GETQUOTA 328 /* getquota(). */ #define PRIV_VFS_LINK 329 /* bsd.hardlink_check_uid */ -#define PRIV_VFS_MKNOD_BAD 330 /* Can mknod() to mark bad inodes. */ +#define PRIV_VFS_MKNOD_BAD 330 /* Was: mknod() can mark bad inodes. */ #define PRIV_VFS_MKNOD_DEV 331 /* Can mknod() to create dev nodes. */ #define PRIV_VFS_MKNOD_WHT 332 /* Can mknod() to create whiteout. */ #define PRIV_VFS_MOUNT 333 /* Can mount(). */