Fix null pointer dereference in zfs_freebsd_setacl().

Prevents unprivileged users from panicking the kernel by calling
__acl_delete_*() on files or directories inside a ZFS mount.

MFC after:	3 days
This commit is contained in:
Martin Matuska 2017-03-02 23:23:28 +00:00
parent 642870485c
commit 0132c9cd4a

View File

@ -5871,6 +5871,9 @@ zfs_freebsd_setacl(ap)
if (ap->a_type != ACL_TYPE_NFS4)
return (EINVAL);
if (ap->a_aclp == NULL)
return (EINVAL);
if (ap->a_aclp->acl_cnt < 1 || ap->a_aclp->acl_cnt > MAX_ACL_ENTRIES)
return (EINVAL);