summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/ptrace.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 4b4f72084d1b..74a3d693c196 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -596,18 +596,24 @@ int ptrace_request(struct task_struct *child, long request,
#ifdef CONFIG_BINFMT_ELF_FDPIC
case PTRACE_GETFDPIC: {
+ struct mm_struct *mm = get_task_mm(child);
unsigned long tmp = 0;
+ ret = -ESRCH;
+ if (!mm)
+ break;
+
switch (addr) {
case PTRACE_GETFDPIC_EXEC:
- tmp = child->mm->context.exec_fdpic_loadmap;
+ tmp = mm->context.exec_fdpic_loadmap;
break;
case PTRACE_GETFDPIC_INTERP:
- tmp = child->mm->context.interp_fdpic_loadmap;
+ tmp = mm->context.interp_fdpic_loadmap;
break;
default:
break;
}
+ mmput(mm);
ret = put_user(tmp, (unsigned long __user *) data);
break;