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)
committerCasey Schaufler <casey@schaufler-ca.com>
Tue, 20 Jul 2021 16:17:36 +0000 (09:17 -0700)
commit6d14f5c7028eea70760df284057fe198ce7778dd
tree46d0550c4a1377d867486aa00653c3b65cbaf800
parent2734d6c1b1a089fb593ef6a23d4b70903526fe0c
Smack: Fix wrong semantics in smk_access_entry()

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>
security/smack/smack_access.c