]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Make CRIS use generic copy_siginfo_to_user
authorStephen Rothwell <sfr@canb.auug.org.au>
Mon, 15 Jul 2002 05:53:00 +0000 (22:53 -0700)
committerJames Morris <jmorris@intercode.com.au>
Mon, 15 Jul 2002 05:53:00 +0000 (22:53 -0700)
 The CRIS architecture is also able to use the generic
 copy_siginfo_to_user.

arch/cris/kernel/signal.c
include/asm-cris/siginfo.h

index 2e75f5c0298e902f38a771dcd77a3c3fd3e1fa06..bfd339c104d25c06c5a7370d1308a4090842b1f4 100644 (file)
 
 int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs);
 
-int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from)
-{
-       if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t)))
-               return -EFAULT;
-       if (from->si_code < 0)
-               return __copy_to_user(to, from, sizeof(siginfo_t));
-       else {
-               int err;
-
-               /* If you change siginfo_t structure, please be sure
-                  this code is fixed accordingly.
-                  It should never copy any pad contained in the structure
-                  to avoid security leaks, but must copy the generic
-                  3 ints plus the relevant union member.  */
-               err = __put_user(from->si_signo, &to->si_signo);
-               err |= __put_user(from->si_errno, &to->si_errno);
-               err |= __put_user((short)from->si_code, &to->si_code);
-               /* First 32bits of unions are always present.  */
-               err |= __put_user(from->si_pid, &to->si_pid);
-               switch (from->si_code >> 16) {
-               case __SI_FAULT >> 16:
-                        err |= __put_user(from->si_addr, &to->si_addr);
-                       break;
-               case __SI_CHLD >> 16:
-                       err |= __put_user(from->si_utime, &to->si_utime);
-                       err |= __put_user(from->si_stime, &to->si_stime);
-                       err |= __put_user(from->si_status, &to->si_status);
-               default:
-                       err |= __put_user(from->si_uid, &to->si_uid);
-                       break;
-               /* case __SI_RT: This is not generated by the kernel as of now.  */
-               }
-               return err;
-       }
-}
-
 /*
  * Atomically swap in the new signal mask, and wait for a signal.  Define 
  * dummy arguments to be able to reach the regs argument.  (Note that this
index a8c8c74dc9df4f30943b9dd36360014121a6ff42..c1cd6d16928b4dbf974334dd6db1c3e175aa2f70 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef _CRIS_SIGINFO_H
 #define _CRIS_SIGINFO_H
 
-#define HAVE_ARCH_COPY_SIGINFO_TO_USER
-
 #include <asm-generic/siginfo.h>
 
 #endif