From patchwork Tue Apr 5 22:08:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 8756191 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 3079CC0553 for ; Tue, 5 Apr 2016 22:21:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04FD22021F for ; Tue, 5 Apr 2016 22:21:53 +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 BDF46201FA for ; Tue, 5 Apr 2016 22:21:51 +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 1anZKA-0007hC-Gy; Tue, 05 Apr 2016 22:19:50 +0000 Received: from mail-bn1on0065.outbound.protection.outlook.com ([157.56.110.65] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1anZDs-0000EB-7I for linux-arm-kernel@lists.infradead.org; Tue, 05 Apr 2016 22:13:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-caviumnetworks-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nOMpsplU4cwA54BZr0q7FXWWTacGJEBW+auHUEIfM+c=; b=salvyJpyTH9i4d8ZvC+rGhzFSS686RpqnP4xrtu99wZ6D/x9z2/Wl3VS1lxhlrWu2bnYwVPih7+lxlALe/WWLSLwUgsgQyOPQ1vtB1pFtCM7DRV0IdEWrq9hH/7ZFDDp+DcBYfjwet/gJSrXWF/7ENCOH7ktCrkyH4zmruKDn9I= Authentication-Results: arndb.de; dkim=none (message not signed) header.d=none;arndb.de; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost (95.143.213.121) by DM2PR07MB623.namprd07.prod.outlook.com (10.141.177.148) with Microsoft SMTP Server (TLS) id 15.1.447.15; Tue, 5 Apr 2016 22:12:57 +0000 From: Yury Norov To: , , , Subject: [PATCH 22/25] arm64: signal32: move ilp32 and aarch32 common code to separated file Date: Wed, 6 Apr 2016 01:08:44 +0300 Message-ID: <1459894127-17698-23-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459894127-17698-1-git-send-email-ynorov@caviumnetworks.com> References: <1459894127-17698-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM2PR03CA0017.eurprd03.prod.outlook.com (10.160.207.27) To DM2PR07MB623.namprd07.prod.outlook.com (10.141.177.148) X-MS-Office365-Filtering-Correlation-Id: 0b9c4179-0454-4a4e-1168-08d35d9f71d6 X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB623; 2:wpGtlwdNZu+jjD4q08an6cTsjRnGYv9ppUUCc/zI+8bGO/HtfHQnnafvYjP9RoSksjrqWkNs1EKJgrgiYLdawXdko706iG7cX8DeCfd03/pQj8qgCgZ+zOynruHL1Mz8S7pDcxAnoUtmzB4zhJLMIWSl+aYQLC+upNCwr5K4iqrxlWRPAWjNkcQ7NuTwPv6k; 3:aHn4f4j86PLMTWNhzWiy/OBT6q58BmvMptjCEhWxMa0GGhi2P6/wJkoI0baauQKHH3NifPZkkxKmZICwdH+zQSX8fXCpKQMt/s9bTk/2SLaEIP/SSIHF2oZ14WGOTwN+; 25:QMPD3QgiDtqkXgzGxjHisCLyavdjQdkqNdfi/o2VrrzBjJ9GLny9vckvXcgMPEFdQQAUYl5sLg/dif0NTZW8PKsSPOcY2HPGHSGD4Ja7RTSnET+QpAi5cn3CAX9CgwgmHCIGUjsbhGz0VZ27r3hQcUK0MoFavsai01rJVhR5Bw5cQztRVIb/vUakUaHUkvNQtDhVul2NhFo8coBsCiOYRfL4SRzADal7WoVktj+FiB9GP7u9d70XcurMD/2UA+4HLU/EuA8ACCrss8uRJkK0h3p/AYuuByQ/EM5abK0bhZoTuaz1C0Gf8kX1GvpEqEsBHQ7Lxr4OaPNpRo9JNcgnWxN2FEvzPmZ2nLCp002EGNM= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB623; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB623; 20:QxaOxo1IWP7WvjrzQ6qeWggmj2DT7ksF5Ke2q7k2omfalVLn0AXsk1tg9bp3qvl+ZoSTt11wSC6EXPy4s1thiruLV6aJsfZgJJnF1pDmp14GQTgp5IWt9/TsvW5aXH0vHQZm3B1xmHO8ysS2edwH9eeA4csN1EnaqppktnLxRrIpobfS95aTpeWfbUzgdNtORX/zj/chS4nz4PuptKs8yUyu4nun3bx5r5vJYhzlwgfXKBC32trAhF0NhGP9950GmWp0zfgl2vDRADRzsxrxY4z4+PbOz4CF4VSLG4e2jXCJUkXf+VMZAHtBRIAl1/0SxPhzoD7O5l8fr8/9aRgTV748cAqOZv9MVGJ2hPxUAUX3z2KmJiRUvyjeCXN5BWWCaxzfF0fTJpUVTts9zmVf4gj0VnI+CUAvi6wDBLVUCM0zyETTKYJDFo6KMIUZfI4tzLR+3a8dOPs3TCIxBLBv6YrkyFuDe0O1DnFXSawQqqMS92LexCw9iuoEoUFPVENby0Yo3eogF/2s+uPOploKJpvJdTwOC+OBrV30iM57qaN83UiVsA+t+mg/FFNhKW0n1GUcAMu7xtBGEPoIgEzYxW+5K5ON/kkfTv845QYhgjk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:DM2PR07MB623; BCL:0; PCL:0; RULEID:; SRVR:DM2PR07MB623; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB623; 4:5mQe+dmdTluFYg6S50zc1XaICY7Ok/wWK8gca9fKARcv+4XMJ1fwv+mVw5Kahr9C74C0SZKYuy/1Q8u05nhmtaENZ69B2R2JeVPPdm1OYbdw6Sm/2w+CKi2B5yRX24J2h5OUhMD65xsm0SXgPO9aktd8eGHA3hd7N67JuGvfXkoVNkt3Z7NgchKeEEg9J9QSNewlPAQwRtDNNoBBT/0x+Ygnac2dQUjPiRuwrjx7BmlyodUSbrZTi1S4diGDJXYpAmIUS5hoH1jX7JTPD6XAhK3+dfKhASbzjIJf06hAsBO3kyqF8cysZeBz4B6QLqN7hrgevD8PXDgrm1QZ4OMr25qsLwftPb27+NX40bqgheK5HYWkSg8puDSaj15QV3nL X-Forefront-PRVS: 0903DD1D85 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(1096002)(2201001)(81166005)(189998001)(3846002)(6116002)(36756003)(5004730100002)(586003)(229853001)(50226001)(2950100001)(76506005)(48376002)(50466002)(47776003)(42186005)(33646002)(19580395003)(92566002)(77096005)(4326007)(2906002)(15975445007)(66066001)(19580405001)(5001770100001)(76176999)(50986999)(5003940100001)(5008740100001)(2004002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR07MB623; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR07MB623; 23:7PdziraLZZLchjBcZ6U2g073LXDrboesQbPPkBsyld?= =?us-ascii?Q?THGl7JiBhyOIXgMfGcYRu9fz9uNYb3JYoJLfptCfmdVrD3o45CROZ4j6UWXt?= =?us-ascii?Q?MnrIGNbfNujCMldPI/lm+pZC3sD54lbVSVz9NTRXp1u0aaC+lv6WJ7sf/4Gw?= =?us-ascii?Q?kHqu2pJqnfFOGMaTPNRVu2VpIg9Dau4Ifg+vnh39Jhh2lJ/m/F6b1pXCohhj?= =?us-ascii?Q?LMM9Jh5JUDWIlAEB4H6BbC8nrIy69c+STjHKV82o/DLevyTVvHeRp5O7VfyY?= =?us-ascii?Q?N422In5rJ22F82ipjFPnlIWeWPqmQ1h2JzXa7xm2GRbaOjpuF5rFpn6sZyUj?= =?us-ascii?Q?SMAFIH6cpRn2rRSFohlf5lzGxktPWHZGL/TVW1I3vWq93LvORKpSwdxLDMsv?= =?us-ascii?Q?XLkfbILYDgHd+wb0mxiA3kncAWXCvOdUVrTU8J4jcKeAlQtVXjlQdChfFhLD?= =?us-ascii?Q?3SnicMfldc5pc8IRNWwjxQTPsvfC8aO4SsBho2AoJJgWc7IVSnB/9glT2eY8?= =?us-ascii?Q?h/yXSxV0QLXQndvmU8CI+e53zljKxJJiTDvw33huVT/G98g73F+GrJFKQFQZ?= =?us-ascii?Q?74xxYqAr7JZyVLViKQc+paVc6z0fv4Y/CahsyTo4NVK7hxZSd8oO1OYG58d8?= =?us-ascii?Q?x2MYQGCnZ6t4AkN38Zhd6nq9XiGySRExRmCD70lyDCSKJtjbxfewptunK76E?= =?us-ascii?Q?55xR/wrtrMwDdGngA9hLuXHCATmOnuDlnLAMTWZXWEeqgNqvL3v/+51Nposk?= =?us-ascii?Q?mAjO/X6xqZOULTPRU1zFHdOh8g1utmThBnWSdPevM0mXFbxXYc1Z5ofXT748?= =?us-ascii?Q?+XK4DUvNv5bJBueq4Plp5vqI4nAuYpKPrgDlTLG9YCp2Gzjs9Y5jwhgV8/2D?= =?us-ascii?Q?wHeWTcGpzLqMWw5c2UCg2FQUk+vGzAa0MwWR+4RPhnUTzmpYqga7Kl9yvw3s?= =?us-ascii?Q?sJNq7D369vONzWZT+fWBGGmT14GKWU6eGyGmpmcYxtCqY07w9caPGntGKUiQ?= =?us-ascii?Q?8=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB623; 5:qWg+ibK/jLNh2W162wNSyP/ty5/a/48/MgNvK5mOpMB0hh3xhdCiEYFRMifocdbjl8c1jdyMzPWOwRWLWFe2fAlOGyGiR524XPNjSoAsj2R6HwqZeqEVkWHzZmu8k9eU1q6p7XgntEMjXr4DTA06YA==; 24:FPvex/pBQu8PzcEUfw2oPks4uFyCxoSuLX/v2JKaq7fUp9I5YnsZ+JAHVTObJn9noE881Wv/Qpms2jgghi5Oou5NebiaJd9jTR8QoCJELjg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2016 22:12:57.6503 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR07MB623 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160405_151321_247859_B139AC1C X-CRM114-Status: GOOD ( 15.77 ) 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: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, pinskia@gmail.com, Prasun.Kapoor@caviumnetworks.com, schwab@suse.de, broonie@kernel.org, linux-doc@vger.kernel.org, heiko.carstens@de.ibm.com, agraf@suse.de, klimov.linux@gmail.com, ynorov@caviumnetworks.com, bamvor.zhangjian@huawei.com, schwidefsky@de.ibm.com, Nathan_Lynch@mentor.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=-5.1 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, 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 | 25 +++++++ arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/signal32.c | 85 ----------------------- arch/arm64/kernel/signal32_common.c | 115 +++++++++++++++++++++++++++++++ 4 files changed, 141 insertions(+), 85 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..b4f2099 --- /dev/null +++ b/arch/arm64/include/asm/signal32_common.h @@ -0,0 +1,25 @@ +/* + * 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 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 /* __ASM_SIGNAL32_COMMON_H */ + diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 7aa65ea..3ed55eb 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -29,6 +29,7 @@ arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ sys_compat.o entry32.o \ ../../arm/kernel/opcodes.o binfmt_elf32.o arm64-obj-$(CONFIG_ARM64_ILP32) += binfmt_ilp32.o sys_ilp32.o +arm64-obj-$(CONFIG_COMPAT) += signal32_common.o arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o arm64-obj-$(CONFIG_ARM64_MODULE_PLTS) += module-plts.o diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index b7063de..b103af3 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 explicitly 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..8fbb609 --- /dev/null +++ b/arch/arm64/kernel/signal32_common.c @@ -0,0 +1,115 @@ +/* + * Based on arch/arm/kernel/signal.c + * + * Copyright (C) 1995-2009 Russell King + * Copyright (C) 2012 ARM Ltd. + * 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 explicitly 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; +} +