From b0594437d3592f327e0de8d42a32e52b82506a96 Mon Sep 17 00:00:00 2001 From: trasz Date: Thu, 13 May 2010 15:31:00 +0000 Subject: [PATCH] Add missing check to prevent local users from panicing the kernel by trying to set malformed ACL. MFC after: 3 days --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index 225beca116de..2522780925e0 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -4939,6 +4939,10 @@ zfs_freebsd_setacl(ap) if (ap->a_aclp->acl_cnt * 2 + 6 > ACL_MAX_ENTRIES) return (ENOSPC); + error = acl_nfs4_check(ap->a_aclp, ap->a_vp->v_type == VDIR); + if (error != 0) + return (error); + vsecattr.vsa_mask = VSA_ACE; aclbsize = ap->a_aclp->acl_cnt * sizeof(ace_t); vsecattr.vsa_aclentp = kmem_alloc(aclbsize, KM_SLEEP);