Commit 0752d7bf authored by Eric W. Biederman's avatar Eric W. Biederman

ptrace: Use copy_siginfo in setsiginfo and getsiginfo

Now that copy_siginfo copies all of the fields this is safe, safer (as
all of the bits are guaranteed to be copied), clearer, and less error
prone than using a structure copy.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent ea64d5ac
...@@ -659,7 +659,7 @@ static int ptrace_getsiginfo(struct task_struct *child, siginfo_t *info) ...@@ -659,7 +659,7 @@ static int ptrace_getsiginfo(struct task_struct *child, siginfo_t *info)
if (lock_task_sighand(child, &flags)) { if (lock_task_sighand(child, &flags)) {
error = -EINVAL; error = -EINVAL;
if (likely(child->last_siginfo != NULL)) { if (likely(child->last_siginfo != NULL)) {
*info = *child->last_siginfo; copy_siginfo(info, child->last_siginfo);
error = 0; error = 0;
} }
unlock_task_sighand(child, &flags); unlock_task_sighand(child, &flags);
...@@ -675,7 +675,7 @@ static int ptrace_setsiginfo(struct task_struct *child, const siginfo_t *info) ...@@ -675,7 +675,7 @@ static int ptrace_setsiginfo(struct task_struct *child, const siginfo_t *info)
if (lock_task_sighand(child, &flags)) { if (lock_task_sighand(child, &flags)) {
error = -EINVAL; error = -EINVAL;
if (likely(child->last_siginfo != NULL)) { if (likely(child->last_siginfo != NULL)) {
*child->last_siginfo = *info; copy_siginfo(child->last_siginfo, info);
error = 0; error = 0;
} }
unlock_task_sighand(child, &flags); unlock_task_sighand(child, &flags);
......
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