From nobody@FreeBSD.org  Tue Jul 22 03:31:09 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1665D1065671
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Jul 2008 03:31:09 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id EAD198FC1F
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Jul 2008 03:31:08 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m6M3V8lB055529
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Jul 2008 03:31:08 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m6M3V8cD055528;
	Tue, 22 Jul 2008 03:31:08 GMT
	(envelope-from nobody)
Message-Id: <200807220331.m6M3V8cD055528@www.freebsd.org>
Date: Tue, 22 Jul 2008 03:31:08 GMT
From: Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: nfs_decode_args() reads invalid memory when called from userspace
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         125849
>Category:       kern
>Synopsis:       [nfs] nfs_decode_args() reads invalid memory when called from userspace
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dfr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 22 03:40:03 UTC 2008
>Closed-Date:    Thu Mar 26 12:44:35 UTC 2009
>Last-Modified:  Thu Mar 26 12:44:35 UTC 2009
>Originator:     Nathan Whitehorn
>Release:        8.0-CURRENT
>Organization:
University of Wisconsin
>Environment:
FreeBSD ceto.tachypleus.net 8.0-CURRENT FreeBSD 8.0-CURRENT #729: Mon Jul 21 17:58:55 CDT 2008     root@trantor.tachypleus.net:/usr/obj/powerpc/usr/src/sys/CETO  powerpc
>Description:
Starting with revision 1.206 of nfs_vfsops.c, the function nfs_decode_args()
terminates by doing 

strlcpy(nmp->nm_hostname, argp->hostname, sizeof(nmp->nm_hostname)
p = strchr(nmp->nm_hostname, ':');
if (p)
  	*p = '\0';

When called from userspace by updating a mount (as happens when an NFS
root is remounted read-only), argp->hostname is a pointer in the address
space of the calling userspace code. Since the kernel doesn't do copyin(),
it copies potentially invalid memory. On 64-bit PowerPC systems, this
causes a kernel panic. since low memory is not generally mapped into
kernel space.
>How-To-Repeat:

>Fix:
I'm not sure what this code is for -- the commit message is about other
code -- and removing it seems harmless.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dfr 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Jul 22 03:41:38 UTC 2008 
Responsible-Changed-Why:  
Over to committer of nfs_vfsops.c 1.206. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125849 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/125849: commit references a PR
Date: Thu, 24 Jul 2008 13:42:49 +0000 (UTC)

 dfr         2008-07-24 13:42:28 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/nfsclient        nfs_vfsops.c 
   Log:
   SVN rev 180779 on 2008-07-24 13:42:28Z by dfr
   
   Don't use a userspace pointer in the kernel when trying to record the hostname
   which we need for NLM requests.
   
   PR:             125849
   
   Revision  Changes    Path
   1.209     +12 -8     src/sys/nfsclient/nfs_vfsops.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/125849: commit references a PR
Date: Thu, 24 Jul 2008 14:02:21 +0000 (UTC)

 dfr         2008-07-24 14:02:03 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/nfsclient        nfs_vfsops.c 
   Log:
   SVN rev 180780 on 2008-07-24 14:02:03Z by dfr
   
   Try again not to use a userspace pointer in the kernel when trying to record
   the hostname which we need for NLM requests. The previous patch was incomplete.
   
   PR:             125849
   Pointy hat:     dfr
   
   Revision  Changes    Path
   1.210     +1 -1      src/sys/nfsclient/nfs_vfsops.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Thu Mar 26 12:41:58 UTC 2009 
State-Changed-Why:  
This appears to have been fixed in HEAD and MFC'd July-August 2008 

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