Smack: remove unneeded NULL-termination from securtity label
authorKonstantin Khlebnikov <k.khlebnikov@samsung.com>
Thu, 7 Aug 2014 16:52:49 +0000 (20:52 +0400)
committerDamian Hobson-Garcia <dhobsong@igel.co.jp>
Thu, 11 Dec 2014 07:53:32 +0000 (16:53 +0900)
commitf92a438b7685a6307b42c353c9f8a622056246b4
tree66b97fb7f5276a05f642449110efe05553590a9e
parentefe56b18f2ce21a508a27d03b3400d553bc31e05
Smack: remove unneeded NULL-termination from securtity label

Values of extended attributes are stored as binary blobs. NULL-termination
of them isn't required. It just wastes disk space and confuses command-line
tools like getfattr because they have to print that zero byte at the end.

This patch removes terminating zero byte from initial security label in
smack_inode_init_security and cuts it out in function smack_inode_getsecurity
which is used by syscall getxattr. This change seems completely safe, because
function smk_parse_smack ignores everything after first zero byte.

Change-Id: I131879e36fc9e71b65857b46714ccd0e512fc83c
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
(cherry picked from commit a99ae8658f4402b6ecdd62cd5414e32356aa3025)

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
security/smack/smack_lsm.c