Commit f9bbf25e authored by Heiko Carstens's avatar Heiko Carstens Committed by Vasily Gorbik

s390/ptrace: fix PTRACE_GET_LAST_BREAK error handling

Return -EFAULT if put_user() for the PTRACE_GET_LAST_BREAK
request fails, instead of silently ignoring it.
Reviewed-by: default avatarSven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 7bb2107e
...@@ -474,9 +474,7 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -474,9 +474,7 @@ long arch_ptrace(struct task_struct *child, long request,
} }
return 0; return 0;
case PTRACE_GET_LAST_BREAK: case PTRACE_GET_LAST_BREAK:
put_user(child->thread.last_break, return put_user(child->thread.last_break, (unsigned long __user *)data);
(unsigned long __user *) data);
return 0;
case PTRACE_ENABLE_TE: case PTRACE_ENABLE_TE:
if (!MACHINE_HAS_TE) if (!MACHINE_HAS_TE)
return -EIO; return -EIO;
...@@ -824,9 +822,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -824,9 +822,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
} }
return 0; return 0;
case PTRACE_GET_LAST_BREAK: case PTRACE_GET_LAST_BREAK:
put_user(child->thread.last_break, return put_user(child->thread.last_break, (unsigned int __user *)data);
(unsigned int __user *) data);
return 0;
} }
return compat_ptrace_request(child, request, addr, data); return compat_ptrace_request(child, request, addr, data);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment