From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 10:29:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A71E410656A6; Mon, 23 Aug 2010 10:29:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 0772D8FC1A; Mon, 23 Aug 2010 10:29:00 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7NASwqM058049 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Aug 2010 13:28:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o7NASwkj014047; Mon, 23 Aug 2010 13:28:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7NASwBF014046; Mon, 23 Aug 2010 13:28:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 23 Aug 2010 13:28:58 +0300 From: Kostik Belousov To: Brian Somers Message-ID: <20100823102858.GD2396@deviant.kiev.zoral.com.ua> References: <201008230533.o7N5XVxa028293@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q5PQdybHXkW1/peZ" Content-Disposition: inline In-Reply-To: <201008230533.o7N5XVxa028293@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211684 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 10:29:01 -0000 --q5PQdybHXkW1/peZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 23, 2010 at 05:33:31AM +0000, Brian Somers wrote: > Author: brian > Date: Mon Aug 23 05:33:31 2010 > New Revision: 211684 > URL: http://svn.freebsd.org/changeset/base/211684 >=20 > Log: > uio_resid isn't updated by VOP_READDIR for nfs filesystems. Use > the uio_offset adjustment instead to calculate a correct *len. Isn't this should be fixed in nfs instead ? Please note that the moral equivalent of the code is also present in compat/linux/linux_cwd.c: linux_getcwd_scandir(). I did not inspected other callers of VOP_READDIR. > =20 > Without this change, we run off the end of the directory data > we're reading and panic horribly for nfs filesystems. > =20 > MFC after: 1 week >=20 > Modified: > head/sys/kern/vfs_default.c >=20 > Modified: head/sys/kern/vfs_default.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/vfs_default.c Mon Aug 23 05:33:20 2010 (r211683) > +++ head/sys/kern/vfs_default.c Mon Aug 23 05:33:31 2010 (r211684) > @@ -281,10 +281,9 @@ get_next_dirent(struct vnode *vp, struct > if (error) > return (error); > =20 > - *off =3D uio.uio_offset; > - > *cpos =3D dirbuf; > - *len =3D (dirbuflen - uio.uio_resid); > + *len =3D uio.uio_offset - *off; > + *off =3D uio.uio_offset; > } > =20 > dp =3D (struct dirent *)(*cpos); --q5PQdybHXkW1/peZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkxyTWkACgkQC3+MBN1Mb4hVnQCgzC0YD5HQPnEg3NpIuKXIqWVb 0WMAnA7Aps14cDsNFgQzoG0AK2RFtXdI =CSb4 -----END PGP SIGNATURE----- --q5PQdybHXkW1/peZ--