BACKPORT: SMACK: Do not apply star label in smack_setprocattr hook
authorHimanshu Shukla <himanshu.sh@samsung.com>
Thu, 10 Nov 2016 10:47:49 +0000 (16:17 +0530)
committerRafal Krypa <r.krypa@samsung.com>
Mon, 21 Nov 2016 16:09:15 +0000 (17:09 +0100)
commitc4f6b186b79a109d49e62f9b9ff945e08c477ad0
treed2681c57b0ee1b4d79b6f881d65fd56eb80bcea3
parent7c1adb099cc0e8af3d9b8ca01cb4d86dba8952d0
BACKPORT: SMACK: Do not apply star label in smack_setprocattr hook

Smack prohibits processes from using the star ("*") and web ("@") labels.
Checks have been added in other functions. In smack_setprocattr()
hook, only check for web ("@") label has been added and restricted
from applying web ("@") label.
Check for star ("*") label should also be added in smack_setprocattr()
hook. Return error should be "-EINVAL" not "-EPERM" as permission
is there for setting label but not the label value as star ("*") or
web ("@").

Signed-off-by: Himanshu Shukla <himanshu.sh@samsung.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
(cherry-picked from upstream 7128ea159d60a91b3f0a7d10a1ea7d62b53cda93)
security/smack/smack_lsm.c