提交 bc25b308 编写于 作者: M Ma Wupeng 提交者: Zheng Zengkai

mm: reliable: Use EINVAL in reliable_check

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

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

LTP's proc01 test was failing be because this ret code (1):

	proc01      1  TFAIL  :  proc01.c:400: read failed: /proc/self/task/1406366/reliable: errno=EPERM(1): Operation not permitted

To slove this problem, replace EPERM with EINVAL in reliable_check().
Signed-off-by: NMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8b97ad63
......@@ -1264,14 +1264,14 @@ static const struct file_operations proc_oom_score_adj_operations = {
static inline int reliable_check(struct task_struct *task, struct pid *pid)
{
if (!mem_reliable_is_enabled())
return -EPERM;
return -EINVAL;
if (is_global_init(task))
return -EPERM;
return -EINVAL;
if (!task->mm || (task->flags & PF_KTHREAD) ||
(task->flags & PF_EXITING))
return -EPERM;
return -EINVAL;
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册