Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jun 2010 11:27:10 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209100 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201006121127.o5CBRAfk085005@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mm
Date: Sat Jun 12 11:27:10 2010
New Revision: 209100
URL: http://svn.freebsd.org/changeset/base/209100

Log:
  Fix panic in zfs_getsecattr
  
  OpenSolaris onnv-revision:	10295:f7a18a1e9610
  
  Obtained from:	OpenSolaris (Bug ID 6870564)
  Approved by:	pjd, delphij (mentor)
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c	Sat Jun 12 11:25:57 2010	(r209099)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c	Sat Jun 12 11:27:10 2010	(r209100)
@@ -1984,8 +1984,6 @@ zfs_getacl(znode_t *zp, vsecattr_t *vsec
 	if (mask & VSA_ACE) {
 		size_t aclsz;
 
-		zfs_acl_node_t *aclnode = list_head(&aclp->z_acl);
-
 		aclsz = count * sizeof (ace_t) +
 		    sizeof (ace_object_t) * largeace;
 
@@ -1996,8 +1994,17 @@ zfs_getacl(znode_t *zp, vsecattr_t *vsec
 			zfs_copy_fuid_2_ace(zp->z_zfsvfs, aclp, cr,
 			    vsecp->vsa_aclentp, !(mask & VSA_ACE_ALLTYPES));
 		else {
-			bcopy(aclnode->z_acldata, vsecp->vsa_aclentp,
-			    count * sizeof (ace_t));
+			zfs_acl_node_t *aclnode;
+			void *start = vsecp->vsa_aclentp;
+
+			for (aclnode = list_head(&aclp->z_acl); aclnode;
+			    aclnode = list_next(&aclp->z_acl, aclnode)) {
+				bcopy(aclnode->z_acldata, start,
+				    aclnode->z_size);
+				start = (caddr_t)start + aclnode->z_size;
+			}
+			ASSERT((caddr_t)start - (caddr_t)vsecp->vsa_aclentp ==
+			    aclp->z_acl_bytes);
 		}
 	}
 	if (mask & VSA_ACE_ACLFLAGS) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006121127.o5CBRAfk085005>