Skip to content

Commit

Permalink
[IA64] ia32_signal.c: erroneous use of memset/memcpy
Browse files Browse the repository at this point in the history
Found by Alexander Nyberg, improved by Bjorn Helgaas.

- Fix the incorrect argument to sizeof()
- looks like memcpy() code pass was dervived from code that used
  copy_from_user().  But in this case we are doing to kernel space
  to kernel space copy, so memcpy is the right routine, but it
  doesn't return an error code.
 
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Arun Sharma authored and Tony Luck committed Apr 22, 2005
1 parent efab773 commit 7130667
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arch/ia64/ia32/ia32_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,9 @@ __ia32_rt_sigsuspend (compat_sigset_t *sset, unsigned int sigsetsize, struct sig
sigset_t oldset, set;

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

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

sigdelsetmask(&set, ~_BLOCKABLE);

Expand Down

0 comments on commit 7130667

Please sign in to comment.