Whamcloud - gitweb
LU-5150 mdc: Handle empty but non-zero acl xattr 89/11989/3
authorChristopher J. Morrone <morrone2@llnl.gov>
Fri, 19 Sep 2014 01:51:59 +0000 (18:51 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 6 Nov 2014 18:35:53 +0000 (18:35 +0000)
commit5f99bbe6c79d0479804bfa0f9565174964b55c3b
tree55efb18fdd21b986b29419f14579b78824a48461
parent934b021a6b14efb734391c561161c0a3c9285ddd
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.

This patch is back-ported from the following one:
Lustre-commit: 867e301972278e397b57094810821ff884092fd8
Lustre-change: http://review.whamcloud.com/10620

Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Change-Id: I76fb2198e7233261ee65c6527d4f2b78f27022bc
Reviewed-on: http://review.whamcloud.com/11989
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdc/mdc_request.c