Commit 71306671 authored by Arun Sharma's avatar Arun Sharma Committed by Tony Luck

[IA64] ia32_signal.c: erroneous use of memset/memcpy

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: default avatarArun Sharma <arun.sharma@intel.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent efab7739
...@@ -460,10 +460,9 @@ __ia32_rt_sigsuspend (compat_sigset_t *sset, unsigned int sigsetsize, struct sig ...@@ -460,10 +460,9 @@ __ia32_rt_sigsuspend (compat_sigset_t *sset, unsigned int sigsetsize, struct sig
sigset_t oldset, set; sigset_t oldset, set;
scr->scratch_unat = 0; /* avoid leaking kernel bits to user level */ 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)) memcpy(&set.sig, &sset->sig, sigsetsize);
return -EFAULT;
sigdelsetmask(&set, ~_BLOCKABLE); sigdelsetmask(&set, ~_BLOCKABLE);
......
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