Smack: Handle labels consistently in untrusted mounts
authorSeth Forshee <seth.forshee@canonical.com>
Tue, 26 Apr 2016 19:36:22 +0000 (14:36 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 24 Jun 2016 16:02:22 +0000 (11:02 -0500)
commit809c02e091a8272bc8586a5d606565bc900f3467
tree4d1667543575f79ec9e1d905081fed3aedf3e531
parent9f50eda2a9277e0bc51d8ca5dd2ec1d0e73601bc
Smack: Handle labels consistently in untrusted mounts

The SMACK64, SMACK64EXEC, and SMACK64MMAP labels are all handled
differently in untrusted mounts. This is confusing and
potentically problematic. Change this to handle them all the same
way that SMACK64 is currently handled; that is, read the label
from disk and check it at use time. For SMACK64 and SMACK64MMAP
access is denied if the label does not match smk_root. To be
consistent with suid, a SMACK64EXEC label which does not match
smk_root will still allow execution of the file but will not run
with the label supplied in the xattr.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
security/smack/smack_lsm.c