Commit 9c0c44db authored by Roland McGrath's avatar Roland McGrath Committed by Paul Mackerras

[POWERPC] Define copy_siginfo_from_user32

Define the copy_siginfo_from_user32 entry point for powerpc, so
that generic CONFIG_COMPAT code can call it.  We already had the
code rolled into compat_sys_rt_sigqueueinfo, this just moves it
out into the canonical function that other arch's define.
Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e4cc5894
...@@ -621,6 +621,18 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s) ...@@ -621,6 +621,18 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s)
#define copy_siginfo_to_user copy_siginfo_to_user32 #define copy_siginfo_to_user copy_siginfo_to_user32
int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from)
{
memset(to, 0, sizeof *to);
if (copy_from_user(to, from, 3*sizeof(int)) ||
copy_from_user(to->_sifields._pad,
from->_sifields._pad, SI_PAD_SIZE32))
return -EFAULT;
return 0;
}
/* /*
* Note: it is necessary to treat pid and sig as unsigned ints, with the * Note: it is necessary to treat pid and sig as unsigned ints, with the
* corresponding cast to a signed int to insure that the proper conversion * corresponding cast to a signed int to insure that the proper conversion
...@@ -634,9 +646,10 @@ long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo ...@@ -634,9 +646,10 @@ long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo
int ret; int ret;
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
if (copy_from_user (&info, uinfo, 3*sizeof(int)) || ret = copy_siginfo_from_user32(&info, uinfo);
copy_from_user (info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE32)) if (unlikely(ret))
return -EFAULT; return ret;
set_fs (KERNEL_DS); set_fs (KERNEL_DS);
/* The __user pointer cast is valid becasuse of the set_fs() */ /* The __user pointer cast is valid becasuse of the set_fs() */
ret = sys_rt_sigqueueinfo((int)pid, (int)sig, (siginfo_t __user *) &info); ret = sys_rt_sigqueueinfo((int)pid, (int)sig, (siginfo_t __user *) &info);
......
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