MFC r208030:

Add missing check to prevent local users from panicing the kernel by trying
to set malformed ACL.
This commit is contained in:
Edward Tomasz Napierala 2010-05-17 17:56:27 +00:00
parent cea772d1e7
commit 44ba1ebbee

View file

@ -4936,6 +4936,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);