Re: [PATCH] Errenous use of memset and memcpy

Alexander Nyberg
2005-02-20T10:38:42Z

> That should be copy_from_user, and the error checking needs to stay.
>

Makes sense, thanks.

=== arch/ia64/ia32/ia32_signal.c 1.35 vs edited ==--- 1.35/arch/ia64/ia32/ia32_signal.c 2005-01-25 21:23:45 +01:00
+++ edited/arch/ia64/ia32/ia32_signal.c 2005-02-20 11:32:55 +01:00
@@ -460,9 +460,9 @@ __ia32_rt_sigsuspend (compat_sigset_t *s
sigset_t oldset, set;

scr->scratch_unat = 0; /* avoid leaking kernel bits to user level */
- memset(&set, 0, sizeof(&set));
+ memset(&set, 0, sizeof(sigset_t));

- if (memcpy(&set.sig, &sset->sig, sigsetsize))
+ if (copy_from_user(&set.sig, &sset->sig, sigsetsize))
return -EFAULT;