“93dbb393503d53cd226e5e1f0088fe8f4dbaa2b8”上不存在“include/uapi/linux/blktrace_api.h”
提交 9ffb8c29 编写于 作者: S Stefan Berger 提交者: Zheng Zengkai

ima: Do not print policy rule with inactive LSM labels

stable inclusion
from stable-v5.10.101
commit 8027ba480c00d56b7dcedc8f2810c6a749ed907a
bugzilla: https://gitee.com/openeuler/kernel/issues/I5669Z

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8027ba480c00d56b7dcedc8f2810c6a749ed907a

--------------------------------

commit 89677197 upstream.

Before printing a policy rule scan for inactive LSM labels in the policy
rule. Inactive LSM labels are identified by args_p != NULL and
rule == NULL.

Fixes: 483ec26e ("ima: ima/lsm policy rule loading logic bug fixes")
Signed-off-by: NStefan Berger <stefanb@linux.ibm.com>
Cc: <stable@vger.kernel.org> # v5.6+
Acked-by: NChristian Brauner <brauner@kernel.org>
[zohar@linux.ibm.com: Updated "Fixes" tag]
Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 f9851a37
...@@ -1726,6 +1726,14 @@ int ima_policy_show(struct seq_file *m, void *v) ...@@ -1726,6 +1726,14 @@ int ima_policy_show(struct seq_file *m, void *v)
rcu_read_lock(); rcu_read_lock();
/* Do not print rules with inactive LSM labels */
for (i = 0; i < MAX_LSM_RULES; i++) {
if (entry->lsm[i].args_p && !entry->lsm[i].rule) {
rcu_read_unlock();
return 0;
}
}
if (entry->action & MEASURE) if (entry->action & MEASURE)
seq_puts(m, pt(Opt_measure)); seq_puts(m, pt(Opt_measure));
if (entry->action & DONT_MEASURE) if (entry->action & DONT_MEASURE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册