Whamcloud - gitweb
LU-5150 mdc: Handle empty but non-zero acl xattr 20/10620/2
authorChristopher J. Morrone <morrone2@llnl.gov>
Fri, 6 Jun 2014 01:02:43 +0000 (18:02 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 18 Jun 2014 04:25:55 +0000 (04:25 +0000)
commit867e301972278e397b57094810821ff884092fd8
tree050e184a07ca9f6f8e045c0c60c829f24570ff35
parent9ef9c1dc0deb46eb8cc7cafa51e7a81fec16d900
LU-5150 mdc: Handle empty but non-zero acl xattr

We have found that posix_acl_access can have a value
of \002\000\000\000.  In that case body->aclsize is
non-zero, but the there are no actuall acls stored
in the xattr.

In mdc_unpack_acl(), it only checks IS_ERR() on the
pointer returned by posix_acl_from_xattr(), it does not
check for NULL.  Because of the above situation, the
xattr aclsize can be non-zero, but posic_acl_from_xattr()
still returns NULL.  Passing NULL to posix_acl_valid()
crashes the kernel.

We add a check to properly handle the NULL return value.

Change-Id: Ib4f623642b86db2c88923a27cd9e77c870f301af
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/10620
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdc/mdc_request.c