提交 ecafcddb 编写于 作者: Z Zhang Tianxing 提交者: Zheng Zengkai

Revert "imans: Check CAP_SYS_ADMIN in userns associated with IMA NS during configuration."

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4O25G
CVE: NA

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

This reverts commit 7fdd1c66.
Signed-off-by: NZhang Tianxing <zhangtianxing3@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Acked-by: Xiu Jianfeng<xiujianfeng@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 339ed5d5
...@@ -637,16 +637,12 @@ static const struct file_operations ima_data_upload_ops = { ...@@ -637,16 +637,12 @@ static const struct file_operations ima_data_upload_ops = {
static int ima_open_for_children(struct inode *inode, struct file *file) static int ima_open_for_children(struct inode *inode, struct file *file)
{ {
struct ima_namespace *ima_ns = get_current_ns(); struct ima_namespace *ima_ns = get_current_ns();
struct ima_namespace *ima_ns_for_children = current->nsproxy->ima_ns_for_children;
/* Allow to set children configuration only after unshare() */ /* Allow to set children configuration only after unshare() */
if (ima_ns == current->nsproxy->ima_ns_for_children) if (ima_ns == current->nsproxy->ima_ns_for_children)
return -EPERM; return -EPERM;
if (!ns_capable(ima_ns_for_children->user_ns, CAP_SYS_ADMIN)) return ima_open_simple(inode, file);
return -EPERM;
return 0;
} }
static ssize_t ima_write_x509_for_children(struct file *file, static ssize_t ima_write_x509_for_children(struct file *file,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册