aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index df73573e12c9..c28281102082 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -225,15 +225,17 @@ static int check_mem_permission(struct task_struct *task)
225struct mm_struct *mm_for_maps(struct task_struct *task) 225struct mm_struct *mm_for_maps(struct task_struct *task)
226{ 226{
227 struct mm_struct *mm; 227 struct mm_struct *mm;
228 int err;
228 229
229 if (mutex_lock_killable(&task->signal->cred_guard_mutex)) 230 err = mutex_lock_killable(&task->signal->cred_guard_mutex);
230 return NULL; 231 if (err)
232 return ERR_PTR(err);
231 233
232 mm = get_task_mm(task); 234 mm = get_task_mm(task);
233 if (mm && mm != current->mm && 235 if (mm && mm != current->mm &&
234 !ptrace_may_access(task, PTRACE_MODE_READ)) { 236 !ptrace_may_access(task, PTRACE_MODE_READ)) {
235 mmput(mm); 237 mmput(mm);
236 mm = NULL; 238 mm = ERR_PTR(-EACCES);
237 } 239 }
238 mutex_unlock(&task->signal->cred_guard_mutex); 240 mutex_unlock(&task->signal->cred_guard_mutex);
239 241