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, 25 Nov 2014 09:08:34 +0000 (10:08 +0100)
commitf57b7f5bb1c2d7d1fa93a807f3290eae2514ab3f
tree8546e673ba736db567eb9d5fb0857c10b2c981db
parent2feea04e966c9c32a9ae53931f5b54f5a830712c
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