From patchwork Thu Jan 7 23:34:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7980911 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 24D3BBEEE5 for ; Thu, 7 Jan 2016 23:58:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E428D2014A for ; Thu, 7 Jan 2016 23:58:09 +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 A0B9220149 for ; Thu, 7 Jan 2016 23:58:08 +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 1aHKQF-0003j0-3y; Thu, 07 Jan 2016 23:56:51 +0000 Received: from mail-bl2on0064.outbound.protection.outlook.com ([65.55.169.64] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aHKAp-0004PO-8l for linux-arm-kernel@lists.infradead.org; Thu, 07 Jan 2016 23:41:43 +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.361.13; Thu, 7 Jan 2016 23:40:31 +0000 From: Yury Norov To: , , , Subject: [PATCH v6 17/21] arm64: signal32: move ilp32 and aarch32 common code to separated file Date: Fri, 8 Jan 2016 02:34:35 +0300 Message-ID: <1452209679-19445-18-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1452209679-19445-1-git-send-email-ynorov@caviumnetworks.com> References: <1452209679-19445-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM3PR01CA052.eurprd01.prod.exchangelabs.com (10.141.191.42) To BLUPR07MB611.namprd07.prod.outlook.com (10.141.207.16) X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 2:KxNDTB6LJgARWG35EUVxoe4ZANYYmJDN9xhd4AWvcx3FLrjQD88KryFKALo5mJmYpZbmc1t7qZ0nQ/hT9vpKJNNfJzlniz1Icmb5K41rN7t21M/w59fwJx5PNeYSSwrjmH54XZfTweFc4Gscm37E6A==; 3:XLKd5uT9vVT/XN3llSGUX5nYgfG380UOkCX5lkE1eM8QdEkuGEdAbJ6WqXE4smdv7Er3vyF+aLivHfJUpSWEzLKViDj27aUFvbgBaSLo+qKT9iYwGKUG1jyEwrzKip73; 25:bTfQ/cm7F7QQAWc/xNQ8gGkdKW4yKaz/qSrJAQmiKGBm0JfygZ5hSdRm4jCQh1xPRBlUI+AF3etxejiuGz1zRDz2Zbc04FnnGdYDRTZMiM2CZAhKLENT7EvmkuP+0YsdDpZvo3xsxpQpeWDMlf+zfDuTk7VfU+dhXnR2g876CyblmjCqo0R0k4og3JwYl6QDzQh8tRitJsx8k6c1R9Cc83Bt+lbaoSos15rEQNcqeYczex0uZf5epJEolySu7Pre X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR07MB611; X-MS-Office365-Filtering-Correlation-Id: 0b1c302e-4636-4bf5-60b5-08d317bbeec5 X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 20:KVCaMUSZHjgpf0Wn0RlJ9XcTlMBIjlacW2y/hiILvw0pVACHQJviUkv10xHmeQPe/wV5jabQapwzxeVh6aL6rrMavzWbfwkOxKkGs5vLzAcC+P6+9jCbUYW+nh9wj2pHq7/rDI5Di6QlNlf7Gcy8kB/4l600Xfp+gbsbACWENfKZwLcPkACz0qKw3pWcaNIELNwArFeo0CNu9e5ZzwLee0nSZKfPVgeJRP+E13Zw4WMVSfek3uud3Gln/TFtImD5c4uaTWEqNz8PLikfZtaGF6AQYvU1NfjoEdSBdiln3XbxfsN46QyDmJ0z+TUEOFTRGx0JFBeU+ypRUh4aoEekaxwnJqZ6uOOCRF3lasnsbk9PUaaTMIH38AZnhQPHOW9TwXKxZ2meN1i8ES1rcsMSiuwS51bU7EurnhBLEgw9PH7Q9aV9IcUtwA9KtELTAW1QpIfqTja9ixAMjQPVhKBfUILjIFaKORwIujNrahpeQxKrjXKlDrs6Nh9/G/lpbzy/WcWLJatgKrPCu/Lip2NeRmfBJVQyBcJt4lpctY6kjTpDau9CCweL3ImosrP8UxCf/pzI3CD5V5M9mg+vI77xvj8sLQIwfILb0d6lX7+fL0U= 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)(3002001)(10201501046); SRVR:BLUPR07MB611; BCL:0; PCL:0; RULEID:; SRVR:BLUPR07MB611; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 4:uisCgg7d+MYp6Nrk+7Wd7Z4+jnjubdWyNQI6LQf3JSnpf0jCVIDLnsBeB3HVzWaiZask5lY/bv+6MyEfazqzcp1o++w5wUQfp8sFL3mENOn7XbzSxFyomffmhu1an+MtnkYFccI74ZdHEnevt514MaRXOu3rZsenm75oyw6/RDCSVm0YjH3uua23+/++nHbPi6ugaS8yRA7aCICS2Q+cBtElWaVOUwxwt6iQcNnK55EKTGqsGLesXqANqwXjKz1WNgv1E5xEuLgbMM22iUQ/RlcODCYSly2nSDTyOF01I6PzBEMcOAjI9lSDZuulDkOPlDZG46MUr7wXsoXf1rvymqqoash2bgqms/fspBVvqCSSmTj+3W8tODBFRHb5HaNKsdq1mLbnUB1golf0G1jQzH5IUe5x1obeGFZBgP8KewjD/0w4Bg3OLtICW2EgSH1BwLI68jWlfW+rCchLrQSWqA== X-Forefront-PRVS: 0814A2C7A3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(189002)(199003)(5001770100001)(189998001)(5001960100002)(3846002)(586003)(97736004)(5003940100001)(50466002)(5008740100001)(42186005)(48376002)(6116002)(4326007)(2906002)(92566002)(47776003)(19580395003)(87976001)(1096002)(33646002)(15975445007)(76176999)(2201001)(106356001)(101416001)(81156007)(40100003)(36756003)(50226001)(229853001)(105586002)(66066001)(19580405001)(2950100001)(5004730100002)(50986999)(76506005)(122386002)(77096005)(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:rWhINJpG+VkAxkOynfKNyW49xZLOSHwdv7ioPvqNDd?= =?us-ascii?Q?ZAyJcEsD4t9/ej0yRH/qDndrverEmWxfJRkvqGfMnY6ekN+K6VDuEPBzE09E?= =?us-ascii?Q?9+xHFqkrkAVub49tY3cbmYc9rEqcOy1MyqfVgvm0MjKNK7KxkqfMjcCDI4h7?= =?us-ascii?Q?YsQT3KELAxR+7SzuHOUtGfrvROoQNOe40+cF1M7Qe2GscbYTf28j0mKv8rTi?= =?us-ascii?Q?yzXiFV2L1v46pOXnnD/+9lbmmqwsZrAX7I4edfzM3Z6GELB12TMQyyPuupET?= =?us-ascii?Q?ZQ3aY8adODpWQAOD+gVll1A50o68Vh2VxOr9qNVkOOump2gvbL0d++UVXGBD?= =?us-ascii?Q?Qy+LqQbhLCd4qojlc2F2Tvz4RoArW4noBfdcYM7r2MIDBla0TcapN1n9dibz?= =?us-ascii?Q?dhhBkltkEnDnImbjSs/0jJxAu+VLWQ6FcoEn+ykDDOwR74OUlx9nLJKYBkMS?= =?us-ascii?Q?vCPx3E+9QKk4WMkbYwZBs9xBVPuwJuTIKNM/fD17TvvYiD1jVvBlO9rpVQrL?= =?us-ascii?Q?ASzLnUrW/983xlfM0OdHlEe4ReUOQJcjRi4tynX0R12hngnvz+PIwJ92N0m5?= =?us-ascii?Q?cnTJxp3YjXXOTnzU2tMs8kUBDyQ7MWgiZIzQ2mlL2kvdG3p6Frt2Q5smIeA0?= =?us-ascii?Q?WOOqwYVImneRvgejDK9XyVhIVbvAywg80YTO60Ufb6E+669RPdV6Z4NCJFPv?= =?us-ascii?Q?zu30RsfuyMjmzRQ3wVwBRvj6UJMTFXVLIB3078TyTtgUlFZcISVhbpOIb+hy?= =?us-ascii?Q?68Tpjfv5L8hNACbySQH8lvqrqCLH3Q0MDuhuL30MCjtvqx+wUxG10JYCnfIN?= =?us-ascii?Q?KsrGeLQtV5cpG3yL/fboy5nvelg9pIudaPrpvOnuzoyjXV3pzUiPIuNbpNGS?= =?us-ascii?Q?hn7lhxkUpobqG2h7GzJsQjPcRkTXNUHyM69JLghqqC9MuBx5KyUesO19yDsb?= =?us-ascii?Q?+HNI/ZwiU2kDyanseoPtFgMRD24m/qtiEqOQn+FjIlolnPIPRHSL5VLPpLTq?= =?us-ascii?Q?i0iFIr4lXwt8dIGnXG8n4gDXNfYpKLq6MDx0YBVY5BsFmEP5QDVda/nsmWlg?= =?us-ascii?Q?SveC1Pqox1nA7DtjH+NG9PdIQO7iRtiOccrv/VrvSZQ8V35SbB9TeIMonHlC?= =?us-ascii?Q?adXtSqoxs1vU7PQ+TobBIVyKZczqVBAoFalPkBTTWUx5LgonzUlg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB611; 5:LE/xAkl/moTjHrSdyNgWZQYaCD5LIYIj3ljD9p+zfJj+xjFHb4F/pVo93YsndF9tmYNOxLyrWWQhj9R6mlMoQ8VU8m7hMcqCc/QatSudK9P70Wl6evLudrPQcqhx2jsC2q3IHAuc8wN9qU8KilmcfA==; 24:GqqQEZ3LApRSJktfjAOP4jj2NTqSMz5Ffg97q7n9oc8H5muWbnH8CLLUmAjySNXRhyc1j2GkPgDONSfSLkNWdW+tv03UmLhWFTvGHiA8buQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2016 23:40:31.8482 (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-20160107_154056_179764_08BF3853 X-CRM114-Status: GOOD ( 18.13 ) 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, 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; +} +