]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Smack: Fix wrong semantics in smk_access_entry()
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Thu, 15 Jul 2021 09:17:24 +0000 (17:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 09:48:03 +0000 (11:48 +0200)
commitf3f5947867d58b75f0e8cf610f067094ede4dce3
tree731294c088849d0063f8721a08d74f2f2a19d59e
parent51fae54d5ad9d8e9222580f2cdb04a8474f6520b
Smack: Fix wrong semantics in smk_access_entry()

[ Upstream commit 6d14f5c7028eea70760df284057fe198ce7778dd ]

In the smk_access_entry() function, if no matching rule is found
in the rust_list, a negative error code will be used to perform bit
operations with the MAY_ enumeration value. This is semantically
wrong. This patch fixes this issue.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/smack/smack_access.c