[PATCH] make Alpha use generic copy_siginfo_to_user

Stephen Rothwell (sfr@canb.auug.org.au)
Fri, 21 Jun 2002 16:17:58 +1000


Hi Linus,

Having looked closer than before, it seems that Alpha can
use the generic copy_siginfo_to_user function.

Please apply.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.24/arch/alpha/kernel/signal.c 2.5.24-si.1/arch/alpha/kernel/signal.c --- 2.5.24/arch/alpha/kernel/signal.c Sun Jun 9 16:12:26 2002 +++ 2.5.24-si.1/arch/alpha/kernel/signal.c Fri Jun 21 16:15:27 2002 @@ -36,36 +36,6 @@ unsigned long, unsigned long); -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(*(long *)&from->si_signo, (long *)&to->si_signo); - err |= __put_user((short)from->si_code, &to->si_code); - switch (from->si_code >> 16) { - 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_addr, &to->si_addr); - break; - /* case __SI_RT: This is not generated by the kernel as of now. */ - } - return err; - } -} - /* * The OSF/1 sigprocmask calling sequence is different from the * C sigprocmask() sequence.. diff -ruN 2.5.24/include/asm-alpha/siginfo.h 2.5.24-si.1/include/asm-alpha/siginfo.h --- 2.5.24/include/asm-alpha/siginfo.h Mon Jun 3 12:12:59 2002 +++ 2.5.24-si.1/include/asm-alpha/siginfo.h Fri Jun 21 16:15:27 2002 @@ -6,7 +6,6 @@ #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4) #define HAVE_ARCH_COPY_SIGINFO -#define HAVE_ARCH_COPY_SIGINFO_TO_USER #include <asm-generic/siginfo.h> - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/