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>
Tue, 7 Oct 2014 14:51:55 +0000 (16:51 +0200)
commit498c604cfcd699dd1a231acbd889bb7278405f0b
tree5a25b1aa66b640155b37fdc5a65606a7ff51149d
parent936ebd48766cb0f4bb21f77d76ee942ec181240a
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