From patchwork Thu Jan 14 17:23:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 8034631 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 658439F744 for ; Thu, 14 Jan 2016 17:32:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C36D20430 for ; Thu, 14 Jan 2016 17:32:17 +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 BF7C82044B for ; Thu, 14 Jan 2016 17:32:15 +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 1aJljK-0001oR-Qp; Thu, 14 Jan 2016 17:30:38 +0000 Received: from mail-bn1on0066.outbound.protection.outlook.com ([157.56.110.66] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aJlg6-0005uy-TF for linux-arm-kernel@lists.infradead.org; Thu, 14 Jan 2016 17:27:35 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by BY2PR07MB616.namprd07.prod.outlook.com (10.141.222.156) with Microsoft SMTP Server (TLS) id 15.1.361.13; Thu, 14 Jan 2016 17:26:54 +0000 From: Yury Norov To: , , , Subject: [PATCH v6 16/21] arm64: signal32: move ilp32 and aarch32 common code to separated file Date: Thu, 14 Jan 2016 20:23:13 +0300 Message-ID: <1452792198-10718-17-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1452792198-10718-1-git-send-email-ynorov@caviumnetworks.com> References: <1452792198-10718-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: DB5PR02CA0020.eurprd02.prod.outlook.com (25.161.237.30) To BY2PR07MB616.namprd07.prod.outlook.com (10.141.222.156) X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB616; 2:WEUMMw+ACspkFqQmOIcYDmVu7dATT3kmUzU6y3v+Dxc3F8RNwmm3ynKgA1Otr+q977J+GT7+tERvjKJYJg70ODWQ0pUwLbCyjNETLyCryl5rwLxO16XAo8GuY3iP0q9+yAFE9aq9o2aQuqUcuFQMjg==; 3:TJUd6f9pp8P1fDdW2DGox9v7yXBJ/UO70dqiYYWSllbX0v119vwLw+4UkWt3Xvvt8TSKpkKzFbiqCivpMCTbnpj4kXj2E1EsKNEL1gOv8f9xxzzhM+vwyz273+WkL6AS; 25:tD7yKUUg8dAN1iRhZWXFBNmglXVlWljWE+QPAGhni1UdD9n4+nyn2878vfuDl6jtCThhLowVkV7A3PFp0s3ZwYFSY4GfBD0N4ze0Oyadh6EsRrJgeCAYtvBcVtzEmubvsrAkrFE5FTWq78/YtMGDZ0UndJIEH1O/vGY0+0I0W9KZYDg6cdSGubiOwU1oKXDLJJVlb9ra2eUH+4kYUf6YqXpGHkcnsQ/ecaEWi1rLeCpkLgx6QKKhbKZhoO/EUUgK X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB616; X-MS-Office365-Filtering-Correlation-Id: 6383140c-5c28-42a4-c0d3-08d31d07e5e9 X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB616; 20:EAlArykTSzDP08bCjyfy1IUTY2FfDTiBZK5iNAuWPNsW2ZBRFR6s1H9+fCPSjMYf2NaifHQvADi3iRqAOPuWD6f4Wn67X/BlsVvbyZXhgzE49INqpivDJvM6znGKCVt+3pYI+b2ghMWr02EdeUlvWvCJsYZ1YrtyXAepMg6p4R6WtOq35GJFKwbzZm0sGWCNugpyfiGpmVfANTp8KyOplx+VWRtPuNPptHtPRuQAWKd9EtbLP1jDi0KA99QUiw3EYqmwpG+0Kz9LCW+/1cI7niHgGwK4abueRhZUVcdKAOnvvQoXYpNsQUMZmUx2G3wZfMkffKapby2nURGLyYNo54+AH9R2o3efVY7YSLXoiPKwk1V/xVA8qS1HKhlFwlWoA7FzqY7S50k8CQCh1QojbhVw1R37fr9J/OKm95tIvfwFZgCwT+bViE3LGaziJMq4vFvJ0Ty0bAkbVOZp70PHAj6lnkHfB+bVvKeaiDaK9JZ+VkM2g2LNiDRplyml/o3mPG/c+YQHnAqV6PYG4bShGOYk0mHjJkBz9wBaYdX0BYGUeU8I0AGqLWOzKbfN+OWjct5jD6TtpVmtZD4dApWktlcxZvKbBGjWTmeA+x5H3Q4= 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)(520078)(8121501046)(5005006)(10201501046)(3002001); SRVR:BY2PR07MB616; BCL:0; PCL:0; RULEID:; SRVR:BY2PR07MB616; X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB616; 4:luG5auBPm1VdRO0pzuAHh0qRK/KIwGtCKNOLWK3aZoEVra2euKc7AACJ1RM3X0Lf2WI0xFZ9r7NVugUuidh9X+ApQIagWbGFVDDeX4j39g10l67zDQbsPEpfZDTV6QWZav2C+yiri+2M0zkkco8Mw86Gkxun/O6qB0QRLiPiz/zsE9hvs/c1WWkZP4+k3W7DlpJz5CwwcNexR6dzr10r/9Pcw1FBYvfdlsbOFl//ZX5OefW9pf89zkdr8gyrerp0v6WAUhOICsjf3HxTVUh7x+QWbYaQWUEpviaqqtYCysALY20VKSygdtC3WGS/Htah0JkUVStrQHIvEkivcDDwM8ARLgcB/jen/BiHpBBqeaBq4+y+8k/AudbaOa2vGCKG44oJQH3dkX96ICIv4OMRWQlsPcblJcd0eAa4TBjV1xgyWiZnUaShNZiipolZ3sdxBNeUriHMumtdLuZjqariDw== X-Forefront-PRVS: 08213D42D3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(199003)(189002)(15975445007)(36756003)(50466002)(33646002)(229853001)(2201001)(105586002)(5004730100002)(42186005)(76506005)(40100003)(5003940100001)(5008740100001)(19580405001)(2906002)(19580395003)(6116002)(4326007)(92566002)(81156007)(2950100001)(87976001)(5001960100002)(586003)(76176999)(50226001)(1096002)(97736004)(3846002)(47776003)(48376002)(5001770100001)(77096005)(66066001)(101416001)(122386002)(106356001)(189998001)(50986999)(2004002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR07MB616; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; BY2PR07MB616; 23:flXBxbIPRNynf4ZSB0IrW60NYThYg2YxRqBbwFb43G?= =?us-ascii?Q?MR8nK9H0AwdrLtmejWWiZerqZsReYlpyJwCFs2UXk3mDu/KszTAxMUkqd37K?= =?us-ascii?Q?IdaJzkrVBxw+FgwHJ/nOHxes9lNqh7g8133r7xD0PqHUc/iRSGdEDGaIS1QV?= =?us-ascii?Q?k3Goz9/TJHibAP+yFapuld66it9WGWPBLHmO59MgR0oYTZB4LkIkC5oW7MCj?= =?us-ascii?Q?ePV4j6fducs7ixcfmjr/akiu3uhcfkngP+5O9X5heyR8OFXM5d5GQorgOW9+?= =?us-ascii?Q?aGp6aZ+a2bW0PQULLuVp5oqcUH0UkrzrhDDAMkfhqkFxEEksJOs9fBF0KsQw?= =?us-ascii?Q?+4cDOSxJmQvs1Ch4iESD6I73vlOw5IUPzNMKr+QvihmUWFc0OkQ1Mf1OeOba?= =?us-ascii?Q?tKVIFBHlAAuG+/p9fxCjY+5BbxQyakGq+fq2QhHw3YhMq6egesJDeixLbhZM?= =?us-ascii?Q?wGrdNPovjD8xdfONEgociRD8layKny8+2aYJUIyWoBNgp/vCUHUVytN8Qh/F?= =?us-ascii?Q?ZUIoYib+Bgw8+gHqCvd8rhHR9eLDP0y3JTsf5vDB5YW9Uzga4cChrPG49MmY?= =?us-ascii?Q?lzMDG7BefwWRWh+2GyaNSrxai5bDuJ03OBmzib6wgyTSSW8L5ZznUEoR7IVH?= =?us-ascii?Q?xqQlbLjxPNPFo5iOG0YO7bdSoLq2Xz1Fv7wlTdpbsUHJzxyP25hXBFYKEaN8?= =?us-ascii?Q?UkkKwaqDMOgbXuWyK7AABN7qCQnQhVf6qNd4caEW7Xm5nRyQ+d8GYKaGP4tj?= =?us-ascii?Q?RagXnhVFGt3nhyvtE3o2W6ssmToOFFplQElrhCq9Sn9MQUU3lCOuR0PFGgfH?= =?us-ascii?Q?em6WHwBvFQ//YzAjNZ/1umKTbnSPQN6j+82QFB05f9ZYtAaOast7zfcnXgQC?= =?us-ascii?Q?nstVZyZBzPGG/gMqnDTdW+NNIAPRq6PWOTt7J11CqbBkUl4B6njSXTWNmpsx?= =?us-ascii?Q?i11YcISKf2Uc+vAXcDxPzsqJCV1VwqiMtmIQ3ju9X9N3DNLo3fV528TLXNSJ?= =?us-ascii?Q?7ZvUYUwd19f8UaiR6zKnGa71/De8FzCvppJI6Z7WWkphBlVGM2721PA+JkN5?= =?us-ascii?Q?rkapwYye5hUB5jv15NHb3x3QPvper4zARkxSvhOu2lsgYqlAz9dLx32fAprN?= =?us-ascii?Q?lokCah6tYMLEAWhiBZcMirfmNoBIQpN/jtfk1x3bsIs3pH0v/Rfg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB616; 5:E7VnGN6vMaHoseKSo4poQtLakdygYVg23mZr7QuujqeHcE0Zw1PdkSjGBFPzEOcAOMAytz1eykd5mF2GnYHZxuZ5xUFckXxk4rDui9W+U9HDVNUKx5ir4q7F2gxhZYxEQZXW7Wsz+HtCToxiX7IQAg==; 24:v3RCr+e78lQ8y62W2AKIrohONgj1JAFW0Qt/JfwWZz3JJWyldMS9sbsi3u+RnkwA3diT3XA9Enhvo2+cvF25wFRCBELECYfQX30kojp+Qhw= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2016 17:26:54.3650 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB616 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160114_092720_501809_99D1DB25 X-CRM114-Status: GOOD ( 16.76 ) 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, heiko.carstens@de.ibm.com, agraf@suse.de, klimov.linux@gmail.com, ynorov@caviumnetworks.com, jan.dakinevich@gmail.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=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, 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 | 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 a35f2f8..4981933 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_PERF_EVENTS) += perf_regs.o perf_callchain.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..1146f82 --- /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 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; +} +