NetBSD Problem Report #45111

From jruohone@gmail.com  Sun Jul  3 07:33:36 2011
Return-Path: <jruohone@gmail.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 3F3B163BC12
	for <gnats-bugs@gnats.netbsd.org>; Sun,  3 Jul 2011 07:33:36 +0000 (UTC)
Message-Id: <20110703073331.44F4256C5@marx.bitnet>
Date: Sun,  3 Jul 2011 10:33:31 +0300 (EEST)
From: Jukka Ruohonen <jruohonen@iki.fi>
Sender: a b <jruohone@gmail.com>
Reply-To: jruohonen@iki.fi
To: gnats-bugs@gnats.NetBSD.org
Subject: tmpfs panic with mknod(2)
X-Send-Pr-Version: 3.95

>Number:         45111
>Category:       kern
>Synopsis:       tmpfs panic with mknod(2)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 03 07:35:00 +0000 2011
>Closed-Date:    Thu Jul 07 07:33:41 +0000 2011
>Last-Modified:  Thu Jul 07 07:33:41 +0000 2011
>Originator:     Jukka Ruohonen
>Release:        NetBSD 5.99.54
>Organization:
none
>Environment:
>Description:

Using the mknod(2) syscall triggers a panic with tmpfs:

	breakpoint() at netbsd:breakpoint+0x5
	panic() at netbsd:panic+0x27f
	kern_assert() at netbsd:kern_assert+0x2d
	tmpfs_alloc_node() at netbsd:tmpfs_alloc_node+0x2fa
	tmpfs_alloc_file() at netbsd:tmpfs_alloc_file+0x13a
	VOP_MKNOD( at netbsd:VOP_MKNOD+0x84
	do_sys_mknod() at netbsd:do_sys_mknod+0x1f1
	syscall() at netbsd:syscall+0xaa

The assertion is:

	panic:kernel diagnostic assertion "rdev != VNOVAL" failed: file
		"/usr/src/sys/fs/tmpfs/tmpfs_subr.c", line 151

>How-To-Repeat:

The following program reliably triggers the assertion when /tmp is on tmpfs:

	#include <sys/stat.h>

	#include <unistd.h>

	int
	main(void)
	{
		(void)mknod("/tmp/panic", S_IFCHR, -1);

		return 0;
	}

>Fix:

Yes please.

>Release-Note:

>Audit-Trail:
From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45111 CVS commit: src
Date: Sun, 3 Jul 2011 14:34:22 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Sun Jul  3 14:34:22 UTC 2011

 Modified Files:
 	src/distrib/sets/lists/tests: mi
 	src/tests/syscall: Makefile
 Added Files:
 	src/tests/syscall: t_mknod.c

 Log Message:
 Few simple tests for mknod(2), including a skipped one for PR kern/45111.


 To generate a diff of this commit:
 cvs rdiff -u -r1.355 -r1.356 src/distrib/sets/lists/tests/mi
 cvs rdiff -u -r1.33 -r1.34 src/tests/syscall/Makefile
 cvs rdiff -u -r0 -r1.1 src/tests/syscall/t_mknod.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Juergen Hannken-Illjes" <hannken@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45111 CVS commit: src/sys/kern
Date: Sun, 3 Jul 2011 15:25:10 +0000

 Module Name:	src
 Committed By:	hannken
 Date:		Sun Jul  3 15:25:09 UTC 2011

 Modified Files:
 	src/sys/kern: vfs_syscalls.c

 Log Message:
 Return EINVAL when trying to create a device node with "rdev == VNOVAL".

 Fixes PR #45111 "tmpfs panic with mknod(2)".


 To generate a diff of this commit:
 cvs rdiff -u -r1.430 -r1.431 src/sys/kern/vfs_syscalls.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: jruoho@NetBSD.org
State-Changed-When: Thu, 07 Jul 2011 07:33:41 +0000
State-Changed-Why:

This was fixed, thanks.



>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.