Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Return EINVAL when trying to create a device node w...
details: https://anonhg.NetBSD.org/src/rev/ffc321b6952c
branches: trunk
changeset: 766876:ffc321b6952c
user: hannken <hannken%NetBSD.org@localhost>
date: Sun Jul 03 15:25:09 2011 +0000
description:
Return EINVAL when trying to create a device node with "rdev == VNOVAL".
Fixes PR #45111 "tmpfs panic with mknod(2)".
diffstat:
sys/kern/vfs_syscalls.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r c7da58b25c24 -r ffc321b6952c sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c Sun Jul 03 15:24:49 2011 +0000
+++ b/sys/kern/vfs_syscalls.c Sun Jul 03 15:25:09 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls.c,v 1.430 2011/06/17 14:23:51 manu Exp $ */
+/* $NetBSD: vfs_syscalls.c,v 1.431 2011/07/03 15:25:09 hannken Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.430 2011/06/17 14:23:51 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.431 2011/07/03 15:25:09 hannken Exp $");
#ifdef _KERNEL_OPT
#include "opt_fileassoc.h"
@@ -1683,6 +1683,8 @@
break;
}
}
+ if (optype == VOP_MKNOD_DESCOFFSET && vattr.va_rdev == VNOVAL)
+ error = EINVAL;
if (!error) {
switch (optype) {
case VOP_WHITEOUT_DESCOFFSET:
Home |
Main Index |
Thread Index |
Old Index