Smack: fix behavior of smack_inode_listsecurity
authorKonstantin Khlebnikov <k.khlebnikov@samsung.com>
Thu, 7 Aug 2014 16:52:33 +0000 (20:52 +0400)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Thu, 18 Sep 2014 11:02:54 +0000 (13:02 +0200)
commit6bbeb11e8fc578a098283670213c890407429588
tree87d69bb7d0372c7babd96e7f3968fa4c03e1273c
parentd4648ce67e6243f961aa02fe93295e370deaea0b
Smack: fix behavior of smack_inode_listsecurity

Security operation ->inode_listsecurity is used for generating list of
available extended attributes for syscall listxattr. Currently it's used
only in nfs4 or if filesystem doesn't provide i_op->listxattr.

The list is the set of NULL-terminated names, one after the other.
This method must include zero byte at the and into result.

Also this function must return length even if string does not fit into
output buffer or it is NULL, see similar method in selinux and man listxattr.

Change-Id: I3ba4524fead6ef6ab0c93238fa8d422e6b155efb
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
security/smack/smack_lsm.c