Subject: kern/34043: 3.99.22 kernel crashes at *_vptofh() called from vfs_composefh_alloc().
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <mrt@notwork.org>
List: netbsd-bugs
Date: 07/20/2006 16:15:01
>Number:         34043
>Category:       kern
>Synopsis:       3.99.22 kernel crashes at *_vptofh() called from vfs_composefh_alloc().
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 20 16:15:00 +0000 2006
>Originator:     mrt@notwork.org
>Release:        NetBSD 3.99.23
>Organization:
Notwork.
>Environment:
System: NetBSD fons-adae 3.99.23 NetBSD 3.99.23 (WILLIAM) #347: Fri Jul 21 00:55:35 JST 2006 mrt@fons-adae:/sys/arch/amd64/compile/WILLIAM amd64
Architecture: x86_64
Machine: amd64
>Description:
3.99.22 kernel crashes at *_vptofh() called from vfs_composefh_alloc()
used by sys__getfh30().  So, mountd caused panic.

>How-To-Repeat:
"mount netbsd-3.99.22-host:/somedisk /somewhere" from other machines.
>Fix:
Apply following diff to /sys/kern/vfs_syscall.s.c.
fidsize is undefined in old code.

Index: vfs_syscalls.c
===================================================================
RCS file: /home/mrt/src/netbsdcvs/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.254
diff -u -r1.254 vfs_syscalls.c
--- vfs_syscalls.c	19 Jul 2006 12:45:19 -0000	1.254
+++ vfs_syscalls.c	20 Jul 2006 15:46:32 -0000
@@ -1300,7 +1300,7 @@
 		error = EOPNOTSUPP;
 		goto out;
 	}
-	fhsize = 0;
+	fidsize = 0;
 	error = VFS_VPTOFH(vp, NULL, &fidsize);
 	KASSERT(error != 0);
 	if (error != E2BIG) {