From nobody@FreeBSD.org  Wed Jul 11 18:24:05 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 262DE16A46C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 11 Jul 2007 18:24:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 179DC13C458
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 11 Jul 2007 18:24:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l6BIO43m004967
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 11 Jul 2007 18:24:04 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l6BIO4gP004966;
	Wed, 11 Jul 2007 18:24:04 GMT
	(envelope-from nobody)
Message-Id: <200707111824.l6BIO4gP004966@www.freebsd.org>
Date: Wed, 11 Jul 2007 18:24:04 GMT
From: Eric Youngblut <eric.youngblut@isilon.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: nfs_readdirrpc doesn't use copyout to write out dirents
X-Send-Pr-Version: www-3.0

>Number:         114506
>Category:       kern
>Synopsis:       [nfs] nfs_readdirrpc doesn't use copyout to write out dirents
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 11 18:30:04 GMT 2007
>Closed-Date:    
>Last-Modified:  Wed Jul 11 22:09:00 GMT 2007
>Originator:     Eric Youngblut
>Release:        FreeBSD HEAD
>Organization:
Isilon Systems
>Environment:
>Description:
/*
 * Readdir rpc call.
 * Called from below the buffer cache by nfs_doio().
 */
int
nfs_readdirrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
{
...
				dp = (struct dirent *)uiop->uio_iov->iov_base;
				dp->d_fileno = fileno;
				dp->d_snapid = 0;
				dp->d_namlen = len;
				dp->d_reclen = tlen + DIRHDSIZ;
				dp->d_type = DT_UNKNOWN;

This needs to be a call to uiomove() which will do a copyout() into the user-space memory.

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
