Add missing check to prevent local users from panicing the kernel by trying

to set malformed ACL.

MFC after:	3 days
This commit is contained in:
trasz 2010-05-13 15:31:00 +00:00
parent 64c451d29e
commit b0594437d3

View File

@ -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);