From patchwork Tue Dec 15 21:42:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7857681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 186A7BEEE1 for ; Tue, 15 Dec 2015 21:55:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B74DA202FF for ; Tue, 15 Dec 2015 21:55:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A9BA202B8 for ; Tue, 15 Dec 2015 21:55:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a8xXG-0003Bp-7p; Tue, 15 Dec 2015 21:53:30 +0000 Received: from mail-by2on0085.outbound.protection.outlook.com ([207.46.100.85] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a8xVC-000132-EB for linux-arm-kernel@lists.infradead.org; Tue, 15 Dec 2015 21:51:30 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by BLUPR07MB611.namprd07.prod.outlook.com (10.141.207.16) with Microsoft SMTP Server (TLS) id 15.1.337.19; Tue, 15 Dec 2015 21:50:58 +0000 From: Yury Norov To: , , , Subject: [PATCH v6 16/20] arm64: signal32: move ilp32 and aarch32 common code to separated file Date: Wed, 16 Dec 2015 00:42:42 +0300 Message-ID: <1450215766-14765-17-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1450215766-14765-1-git-send-email-ynorov@caviumnetworks.com> References: <1450215766-14765-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM3PR01CA028.eurprd01.prod.exchangelabs.com (10.141.191.18) To BLUPR07MB611.namprd07.prod.outlook.com (10.141.207.16) X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 2:V6u1zllZS0b7h2fUHr55uiFpZ9Vm6KWsCMAIuTGGFVWYoMJhFnylyXrLA60eLOKe+n0t/Rqqc+L117dj0JiGR32bxW37jxyKLHNrtJJMjfBrInnIaosK7KvA7JUl6O+hhcfR5xNyupP3mybtyqMrqQ==; 3:fve4uDjqh3zLOVb9aBGOw9aIfmhz0KtOcjFp2RXQ/ljnkZwQp0YwwHlRVYx/Yyu5z0puJz2LReyoms1xVT34LlLxdE/4ChJBjmWUak/pIRTdl2bPwzD63dd0hdR6KpqF; 25:HiVdcn6WRXYIsz6MpXC3pbAO3VfZO5WkQtro4Zfbua4iGlTMkPYd8CYOpjinFx6JUiDx/JEmOfLPGLsesOZ1jNsN6x53bwwDJsikK7DydLlclU4k9CwunAuLgSglSkQbX0NoUgmvkvF5Ixh8+3l8Wrm2C4RwbqnfwVXqOoAvyzQaOCs9cBw9tgYk7ZNR7PQSgkq5lXrDekdrydwDIVuC1jFISZOB0BfGnDpdwGK/UTYWQuBQL8SAyNdRnov5RMOHw2bbph8U13i8Zg9iL7/dDg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR07MB611; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 20:iwgI9pmbcCwgnuynOra1f2t7MExquX9WPqzLdB0Ni2daEJ4ZTWrXSXi7+6sq93uOtFttWiDPetiPeXSx6IJBisvmYJLjvl0oYDyBDm/Ts5cwddwrCeIFC9/aH9ofjs4WiSZKDaiNMYBvF8l7PiVprc9X6Nc+Pk9I8RgQgQYCgVQTvwHW/odpWPKY9dsElQ9FAQe3titGz23fYeRUv82Bxqybf0oOk0KMNxLsZrejZuh7vGgqTLbBR0j+dAcjvLRs+BZjKECK6S0rfyTANADTm61KLoPI3jamer+e5uwziBOwmvpvurH+tPrM5el59kWS5369ONs1d61iKe1O+hoZs/fIWiC/Z+tY/sF3JP74+tXdx0q8HOVxU6idQ8y+/1bU/duqbM+x/zt36iqF3XuUSDoNZJfQZjjA2wtcP8US7WtRODjoyMmeY4xa7jFja4gtg5q8paYgDbQB0v5SoepfV3NwnlZqvgyP2eNVHogKs3r/rviDqmhvm1zmE+8FtgUT23w6DLMQrekvH3iBZOfijdzL/eQn72B1GJ7cWk4ACT6hE3eTvRDfW8m0CIO6bipJqmD1KPC2nmq20w1jcwEejW8N8Iczsi+FVCcyHvIBXxE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187)(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:BLUPR07MB611; BCL:0; PCL:0; RULEID:; SRVR:BLUPR07MB611; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 4:rKpdaFCj2qoDUtPKLVD9l9unXSn+R7+VqqOtqzKtUsYRyQ4smi4RcSimz/eyhVdQOHI+RTLmqffc0ee017IyrLhiIDMsQTcjXdAFEtNAUyAukQjtnd/lxgbcBUAzffhk0OksuMRJc5NNKjiOFKxbXVp8ZmDPU/DwOHbfZ/p8fYEVPJNzdSlBNQHDjEONK7IL8ps9uMirlE25Fz6ryjmVd/QnP/9jrZy/t3bFw8L+Mxr+aqIVx2pwxYs3i7RzQb5XtfiUMPZra4Wr4iMnOEWcL7c6/WLiFKVL2tAoh7p9lIU2+LRSxinjMRLlCQS0GFlyr4/gBidfiWBF8j8KVi7p4HbOR6hSnmP/YNoY2MJRa8PI72iHfqWxTK7LtzQ1t+aR9FjYTwt2QLy2Gcgjxm/RcNjLLTL6Ob7XirTX5Nd1a83bHv6u26+c13ZguJQ4zrjYP8JWOUayLhiNSpadPwJ26Q== X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(189002)(199003)(106356001)(76176999)(47776003)(3846002)(5008740100001)(5001960100002)(5001770100001)(66066001)(229853001)(81156007)(87976001)(122386002)(97736004)(92566002)(19580395003)(1096002)(33646002)(6116002)(40100003)(586003)(5003940100001)(189998001)(36756003)(105586002)(2950100001)(76506005)(48376002)(50986999)(50466002)(77096005)(42186005)(101416001)(2201001)(19580405001)(15975445007)(50226001)(5004730100002)(2004002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR07MB611; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR07MB611; 23:WSwLGAn5t7JmQymMPMjCPegWMfn5pgAN5TGDIBVGEp?= =?us-ascii?Q?aegk2fLquymsDMwL7eWHcJKEHIlt1LjocwW+Z3Cbfo9/3xM+cFgkjDrq9Dip?= =?us-ascii?Q?VJxaanjApqFXHl6SE61JsyoR1pPFcLu6007T7JofKXi0PmCQw4jt2rBsp4Oc?= =?us-ascii?Q?SJ2Co1KkFVpEwD5z34nSzyQyjsQiYGR3edQT4316wqXSo5SDpttZEvMKcKm/?= =?us-ascii?Q?4bQR3RfeTrSR9q/qanu7EsKaSkAfEVo4ASVVQLExDKY4Qo1Fgs/Xuan2b0yX?= =?us-ascii?Q?vm6i3dk0/tvNNUFmUCK/3Yc+s7Wc1FNTeCQtHjrK7juDeW5cwRRl/MVDrJq7?= =?us-ascii?Q?TUos6PNW9occ8x6Jln5QFLtgf59C8dGikBzmzChlanKz4nuZ4KGm98S+A+N0?= =?us-ascii?Q?MiFlIHkCuJPonpeG/I8K0wqXcM4SYxUPYBytrSDq0j1rSdTCQLtBxyeQqzYO?= =?us-ascii?Q?ofWd6SzidSYJvmiKzf1sf87PKNmxZhfpJyMDqZZ4wWxAboQBCbesWI/BrGIJ?= =?us-ascii?Q?TB4tbVSh7axx4Mk5jdkcvNoacuPCT36Ca1gzeIzR2noAEciWpfwL1pbtruQi?= =?us-ascii?Q?dbh5Zt5iGtUWYcoXC41UH/JGfUOnFwONab0s/OaDuX0cU18w/iPGWbNHBHUY?= =?us-ascii?Q?WiWWqRS76QRbmjF0IjyQE7ipAZS59//89B2tl74d6Q8xRzstRcIMHb6jqVR9?= =?us-ascii?Q?47YU8iTgbOUQZyZxBvw1ABKMYBmkRLiPqY/HpzldHzvZB37y1cBypaEfX5F2?= =?us-ascii?Q?dOtGroua/jtDGD60lvW5033nG4Fh5/SPw3LNfXQitnzaAO8yfdr48P/O+M9p?= =?us-ascii?Q?SNVUwQbwDqVWjKZNe+Qp9OtVEIXU1LxQQhsOGq/yapVHmvnwskCnOLVoFkCf?= =?us-ascii?Q?ksDJpSBJWCH8Wc9lQqs5CQl8HG36VJZuNbQfa4LHxZOrrokTI6dWiaslrsZx?= =?us-ascii?Q?o87eyJ7qbt983tgb4eNSeCIvYfkUvnX6u43wuVI9c2oqnTNFlIPdNHxOrvoU?= =?us-ascii?Q?GlQVW07NOgaWtEB8AwIlvn1ojBC8ptjCgA1fIf7wEkZZr4Sn4DMuDvGcPGn0?= =?us-ascii?Q?WsBkYaZi8fD8qoz+jcyOv5p0BLDJtqlsbxUB916HjpfzcUr4A6PCr4jQq+IA?= =?us-ascii?Q?lyZcy0tDKSag6LEl2mHfw5bXQadfYu?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 5:EJC8RqTip7YytnLTe9swWwCd2qkb/Y3nmQ4AVM7TvC0M4IO9ktKaNBZfhT35dS5qYmC+2miNhKCdlEaVNEpGZfiv6MTaALJPT4aHLH76jojPf/ojgPIj8aPEvEsvVU4obQMmU8l1GlhocvBZklIlnw==; 24:XsXpKbXE9Zip2XkOfDh+jpJZHIdsDMOzBBy5cZ7vmcEieuLzwVYxtnCQJxNdiBFd2pcifB4n0ILC6Irz+c4PQ0e8Iwl5VNuLwn2tCbO1KVI= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2015 21:50:58.9171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR07MB611 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151215_135123_052023_6F5FD287 X-CRM114-Status: GOOD ( 16.58 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pinskia@gmail.com, Prasun.Kapoor@caviumnetworks.com, schwab@suse.de, broonie@kernel.org, Nathan_Lynch@mentor.com, agraf@suse.de, klimov.linux@gmail.com, ynorov@caviumnetworks.com, jan.dakinevich@gmail.com, ddaney.cavm@gmail.com, bamvor.zhangjian@huawei.com, philipp.tomsich@theobroma-systems.com, joseph@codesourcery.com, christoph.muellner@theobroma-systems.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Yury Norov --- arch/arm64/include/asm/signal32_common.h | 30 ++++++++ arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/signal32.c | 85 ---------------------- arch/arm64/kernel/signal32_common.c | 116 +++++++++++++++++++++++++++++++ 4 files changed, 147 insertions(+), 86 deletions(-) create mode 100644 arch/arm64/include/asm/signal32_common.h create mode 100644 arch/arm64/kernel/signal32_common.c diff --git a/arch/arm64/include/asm/signal32_common.h b/arch/arm64/include/asm/signal32_common.h new file mode 100644 index 0000000..37a3a3c --- /dev/null +++ b/arch/arm64/include/asm/signal32_common.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2015 Cavium Networks. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef __ASM_SIGNAL32_COMMON_H +#define __ASM_SIGNAL32_COMMON_H + +#ifdef __KERNEL__ + +#ifdef CONFIG_COMPAT + +int copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from); +int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from); + +#endif /* CONFIG_COMPAT*/ + +#endif /* __KERNEL__ */ +#endif /* __ASM_SIGNAL32_COMMON_H */ + diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 94b8b84..f90fb08 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -25,7 +25,7 @@ arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ ../../arm/kernel/opcodes.o arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o arm64-obj-$(CONFIG_ARM64_ILP32) += sys_ilp32.o -arm64-obj-$(CONFIG_COMPAT) += entry32-common.o +arm64-obj-$(CONFIG_COMPAT) += entry32-common.o signal32_common.o arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o arm64-obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index 71ef6dc..2a69815 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c @@ -125,91 +125,6 @@ static inline int get_sigset_t(sigset_t *set, return 0; } -int copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from) -{ - int err; - - if (!access_ok(VERIFY_WRITE, to, sizeof(*to))) - return -EFAULT; - - /* 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. - * This routine must convert siginfo from 64bit to 32bit as well - * at the same time. - */ - 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); - if (from->si_code < 0) - err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, - SI_PAD_SIZE); - else switch (from->si_code & __SI_MASK) { - case __SI_KILL: - err |= __put_user(from->si_pid, &to->si_pid); - err |= __put_user(from->si_uid, &to->si_uid); - break; - case __SI_TIMER: - err |= __put_user(from->si_tid, &to->si_tid); - err |= __put_user(from->si_overrun, &to->si_overrun); - err |= __put_user(from->si_int, &to->si_int); - break; - case __SI_POLL: - err |= __put_user(from->si_band, &to->si_band); - err |= __put_user(from->si_fd, &to->si_fd); - break; - case __SI_FAULT: - err |= __put_user((compat_uptr_t)(unsigned long)from->si_addr, - &to->si_addr); -#ifdef BUS_MCEERR_AO - /* - * Other callers might not initialize the si_lsb field, - * so check explicitely for the right codes here. - */ - if (from->si_signo == SIGBUS && - (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)) - err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb); -#endif - break; - case __SI_CHLD: - err |= __put_user(from->si_pid, &to->si_pid); - err |= __put_user(from->si_uid, &to->si_uid); - err |= __put_user(from->si_status, &to->si_status); - err |= __put_user(from->si_utime, &to->si_utime); - err |= __put_user(from->si_stime, &to->si_stime); - break; - case __SI_RT: /* This is not generated by the kernel as of now. */ - case __SI_MESGQ: /* But this is */ - err |= __put_user(from->si_pid, &to->si_pid); - err |= __put_user(from->si_uid, &to->si_uid); - err |= __put_user(from->si_int, &to->si_int); - break; - case __SI_SYS: - err |= __put_user((compat_uptr_t)(unsigned long) - from->si_call_addr, &to->si_call_addr); - err |= __put_user(from->si_syscall, &to->si_syscall); - err |= __put_user(from->si_arch, &to->si_arch); - break; - default: /* this is just in case for now ... */ - err |= __put_user(from->si_pid, &to->si_pid); - err |= __put_user(from->si_uid, &to->si_uid); - break; - } - return err; -} - -int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) -{ - if (copy_from_user(to, from, __ARCH_SI_PREAMBLE_SIZE) || - copy_from_user(to->_sifields._pad, - from->_sifields._pad, SI_PAD_SIZE)) - return -EFAULT; - - return 0; -} - /* * VFP save/restore code. * diff --git a/arch/arm64/kernel/signal32_common.c b/arch/arm64/kernel/signal32_common.c new file mode 100644 index 0000000..446c7c0 --- /dev/null +++ b/arch/arm64/kernel/signal32_common.c @@ -0,0 +1,116 @@ +/* + * Based on arch/arm/kernel/signal.c + * + * Copyright (C) 1995-2009 Russell King + * Copyright (C) 2012 ARM Ltd. + * Copyright (C) 2015 Cavium Metworks. + * Modified by Will Deacon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +int copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from) +{ + int err; + + if (!access_ok(VERIFY_WRITE, to, sizeof(*to))) + return -EFAULT; + + /* 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. + * This routine must convert siginfo from 64bit to 32bit as well + * at the same time. + */ + 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); + if (from->si_code < 0) + err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, + SI_PAD_SIZE); + else switch (from->si_code & __SI_MASK) { + case __SI_KILL: + err |= __put_user(from->si_pid, &to->si_pid); + err |= __put_user(from->si_uid, &to->si_uid); + break; + case __SI_TIMER: + err |= __put_user(from->si_tid, &to->si_tid); + err |= __put_user(from->si_overrun, &to->si_overrun); + err |= __put_user(from->si_int, &to->si_int); + break; + case __SI_POLL: + err |= __put_user(from->si_band, &to->si_band); + err |= __put_user(from->si_fd, &to->si_fd); + break; + case __SI_FAULT: + err |= __put_user((compat_uptr_t)(unsigned long)from->si_addr, + &to->si_addr); +#ifdef BUS_MCEERR_AO + /* + * Other callers might not initialize the si_lsb field, + * so check explicitely for the right codes here. + */ + if (from->si_signo == SIGBUS && + (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)) + err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb); +#endif + break; + case __SI_CHLD: + err |= __put_user(from->si_pid, &to->si_pid); + err |= __put_user(from->si_uid, &to->si_uid); + err |= __put_user(from->si_status, &to->si_status); + err |= __put_user(from->si_utime, &to->si_utime); + err |= __put_user(from->si_stime, &to->si_stime); + break; + case __SI_RT: /* This is not generated by the kernel as of now. */ + case __SI_MESGQ: /* But this is */ + err |= __put_user(from->si_pid, &to->si_pid); + err |= __put_user(from->si_uid, &to->si_uid); + err |= __put_user(from->si_int, &to->si_int); + break; + case __SI_SYS: + err |= __put_user((compat_uptr_t)(unsigned long) + from->si_call_addr, &to->si_call_addr); + err |= __put_user(from->si_syscall, &to->si_syscall); + err |= __put_user(from->si_arch, &to->si_arch); + break; + default: /* this is just in case for now ... */ + err |= __put_user(from->si_pid, &to->si_pid); + err |= __put_user(from->si_uid, &to->si_uid); + break; + } + return err; +} + +int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) +{ + if (copy_from_user(to, from, __ARCH_SI_PREAMBLE_SIZE) || + copy_from_user(to->_sifields._pad, + from->_sifields._pad, SI_PAD_SIZE)) + return -EFAULT; + + return 0; +} +