Skip to content

Commit 0752d7b

Browse files
committed
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: "Eric W. Biederman" <ebiederm@xmission.com>
1 parent ea64d5a commit 0752d7b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎kernel/ptrace.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ static int ptrace_getsiginfo(struct task_struct *child, siginfo_t *info)
659659
if (lock_task_sighand(child, &flags)) {
660660
error = -EINVAL;
661661
if (likely(child->last_siginfo != NULL)) {
662-
*info = *child->last_siginfo;
662+
copy_siginfo(info, child->last_siginfo);
663663
error = 0;
664664
}
665665
unlock_task_sighand(child, &flags);
@@ -675,7 +675,7 @@ static int ptrace_setsiginfo(struct task_struct *child, const siginfo_t *info)
675675
if (lock_task_sighand(child, &flags)) {
676676
error = -EINVAL;
677677
if (likely(child->last_siginfo != NULL)) {
678-
*child->last_siginfo = *info;
678+
copy_siginfo(child->last_siginfo, info);
679679
error = 0;
680680
}
681681
unlock_task_sighand(child, &flags);

0 commit comments

Comments
 (0)