smack: Set SMACK64TRANSMUTE only for dirs in smack_inode_setxattr()
authorRoberto Sassu <roberto.sassu@huawei.com>
Thu, 16 Nov 2023 09:01:21 +0000 (10:01 +0100)
committerCasey Schaufler <casey@schaufler-ca.com>
Wed, 24 Jan 2024 22:06:26 +0000 (14:06 -0800)
commit9c82169208dde516510aaba6bbd8b13976690c5d
tree4eada326475bf3ca23f871e5730de4bb40fceb40
parent6613476e225e090cc9aad49be7fa504e290dd33d
smack: Set SMACK64TRANSMUTE only for dirs in smack_inode_setxattr()

Since the SMACK64TRANSMUTE xattr makes sense only for directories, enforce
this restriction in smack_inode_setxattr().

Cc: stable@vger.kernel.org
Fixes: 5c6d1125f8db ("Smack: Transmute labels on specified directories") # v2.6.38.x
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
security/smack/smack_lsm.c