From 6df59de040e14a055f1275de66a76eaeb1e95c2d Mon Sep 17 00:00:00 2001
From: Ma Wupeng <mawupeng1@huawei.com>
Date: Sat, 24 Sep 2022 17:54:01 +0800
Subject: [PATCH] mm: reliable: Fix ret errno to EACCES

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

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

Commit bc25b3081709 ("mm: reliable: Use EINVAL in reliable_check") update
EPERM to EINVAL try to pass LTP's proc01 test, however LTP only treat
EACCESS as whitelist in the scenario.

To solve this problem, update EINVAL to EACCESS.

Fixes: bc25b3081709 ("mm: reliable: Use EINVAL in reliable_check")

Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
Reviewed-by: Chen Wandun <chenwandun@huawei.com>
Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com>
---
 fs/proc/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 0c3a2eb61726..2d1af92653bb 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1264,7 +1264,7 @@ 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 -EINVAL;
+		return -EACCES;
 
 	if (is_global_init(task))
 		return -EINVAL;
-- 
GitLab