Smack: Fix the bug smackcipso can't set CIPSO correctly
authorPassion,Zhao <passion.zhao@intel.com>
Mon, 3 Jun 2013 03:42:24 +0000 (11:42 +0800)
committerChanho Park <parkch98@gmail.com>
Fri, 23 Jan 2015 14:21:09 +0000 (23:21 +0900)
commit227b2393a2cea785031be1b5aa6db6fa7dfa4f03
tree3d4ecb06e01786f6a734fa6518d525fc9a98f8ae
parent2d641ee90fc34922de2200d14f501a5951931b11
Smack: Fix the bug smackcipso can't set CIPSO correctly

Bug report: https://tizendev.org/bugs/browse/TDIS-3891

The reason is userspace libsmack only use "smackfs/cipso2" long-label interface,
but the code's logical is still for orginal fixed length label. Now update
smack_cipso_apply() to support flexible label (<=256 including tailing '\0')

There is also a bug in kernel/security/smack/smackfs.c:
When smk_set_cipso() parsing the CIPSO setting from userspace, the offset of
CIPSO level should be "strlen(label)+1" instead of "strlen(label)"

Change-Id: I7be85b4ade557e25569970e61c9e09ca01b5f2d9
Signed-off-by: Passion,Zhao <passion.zhao@intel.com>
Signed-off-by: Ɓukasz Stelmach <l.stelmach@samsung.com>
security/smack/smackfs.c