From bg@filur.sics.se  Tue Jan 27 09:31:01 2004
Return-Path: <bg@filur.sics.se>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C5A0916A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Jan 2004 09:31:01 -0800 (PST)
Received: from filur.sics.se (filur.sics.se [193.10.66.105])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 984AF43D5A
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Jan 2004 09:30:50 -0800 (PST)
	(envelope-from bg@filur.sics.se)
Received: from filur.sics.se (localhost [127.0.0.1])
	by filur.sics.se (8.12.10/8.12.10) with ESMTP id i0RHT3rc033904;
	Tue, 27 Jan 2004 18:29:03 +0100 (CET)
	(envelope-from bg@filur.sics.se)
Received: (from bg@localhost)
	by filur.sics.se (8.12.10/8.12.10/Submit) id i0RHT34t033903;
	Tue, 27 Jan 2004 18:29:03 +0100 (CET)
	(envelope-from bg)
Message-Id: <200401271729.i0RHT34t033903@filur.sics.se>
Date: Tue, 27 Jan 2004 18:29:03 +0100 (CET)
From: Bjoern Groenvall <bg@sics.se>
Reply-To: Bjoern Groenvall <bg@sics.se>
To: FreeBSD-gnats-submit@freebsd.org
Cc: bg@sics.se
Subject: panic in linprocfs
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         61994
>Category:       kern
>Synopsis:       panic in linprocfs
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 27 09:40:12 PST 2004
>Closed-Date:    Mon Feb 09 12:33:47 PST 2004
>Last-Modified:  Mon Feb 09 12:33:47 PST 2004
>Originator:     Bjoern Groenvall
>Release:        FreeBSD 5.2-RELEASE i386
>Organization:
SICS
>Environment:
System: FreeBSD filur.sics.se 5.2-RELEASE FreeBSD 5.2-RELEASE #0: Thu Jan 22 22:47:09 CET 2004 root@filur.sics.se:/usr/src/sys/i386/compile/FILUR i386


	
>Description:

When linprocfs is synthesizing the mtab file it does not obey the
rules for proper locking.

>How-To-Repeat:

Mount a number of remote NFS file systems and then perform this
command a number of times.

# cat /compat/linux/proc/mtab

>Fix:

To synthesize the mtab file the following fields are used:

f_mntfromname, f_mntonname, f_fstypename, f_flags

All these fields are available without actually calling VFS_STATFS. If
one still insists on calling VFS_STATFS one should follow the locking
protocol.

--- /usr/src/sys/compat/linprocfs/linprocfs.c.orig	Mon Oct 20 06:10:20 2003
+++ /usr/src/sys/compat/linprocfs/linprocfs.c	Thu Jan 22 21:32:53 2004
@@ -364,9 +364,12 @@
 	mtx_lock(&mountlist_mtx);
 	error = 0;
 	TAILQ_FOREACH(mp, &mountlist, mnt_list) {
+#if 0
+		/* Needs proper locking  but is also superfluous. */
 		error = VFS_STATFS(mp, &mp->mnt_stat, td);
 		if (error)
 			break;
+#endif
 
 		/* determine device name */
 		mntfrom = mp->mnt_stat.f_mntfromname;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sun Feb 8 20:41:30 PST 2004 
Responsible-Changed-Why:  
Assign to linprocfs maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61994 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Mon Feb 9 12:33:46 PST 2004 
State-Changed-Why:  
Fixed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61994 
>Unformatted:
