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:02:11 +0000 (17:02 +0100)
commit2b92f54763859ab3a802dddd39ddf7d5a1d7fb33
treea7713f5e580abc3464ea284ff8d59a5f11da255b
parent0b50ad8367338eda241427002f9e5f0f1a2a4086
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