summaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-02-15 22:22:54 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-23 16:36:50 -0400
commitec6fd8a4355cda81cd9f06bebc048e83eb514ac7 (patch)
tree828c3f2e1b474cc0ec9768d5dc19cfa2c086898f /fs/proc/base.c
parentca6b0bf0e086513b9ee5efc0aa5770ecb57778af (diff)
downloadop-kernel-dev-ec6fd8a4355cda81cd9f06bebc048e83eb514ac7.zip
op-kernel-dev-ec6fd8a4355cda81cd9f06bebc048e83eb514ac7.tar.gz
report errors in /proc/*/*map* sanely
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
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 df73573..c282811 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -225,15 +225,17 @@ static int check_mem_permission(struct task_struct *task)
struct mm_struct *mm_for_maps(struct task_struct *task)
{
struct mm_struct *mm;
+ int err;
- if (mutex_lock_killable(&task->signal->cred_guard_mutex))
- return NULL;
+ err = mutex_lock_killable(&task->signal->cred_guard_mutex);
+ if (err)
+ return ERR_PTR(err);
mm = get_task_mm(task);
if (mm && mm != current->mm &&
!ptrace_may_access(task, PTRACE_MODE_READ)) {
mmput(mm);
- mm = NULL;
+ mm = ERR_PTR(-EACCES);
}
mutex_unlock(&task->signal->cred_guard_mutex);
OpenPOWER on IntegriCloud