From patchwork Fri Oct 21 20:33:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 101642 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1486124qge; Fri, 21 Oct 2016 13:35:17 -0700 (PDT) X-Received: by 10.98.87.79 with SMTP id l76mr4774612pfb.174.1477082117875; Fri, 21 Oct 2016 13:35:17 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id f10si4063360pgn.62.2016.10.21.13.35.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Oct 2016 13:35:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@CAVIUMNETWORKS.onmicrosoft.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxgW8-0002FE-0y; Fri, 21 Oct 2016 20:34:16 +0000 Received: from mail-bn3nam01on0049.outbound.protection.outlook.com ([104.47.33.49] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxgVu-0002Ar-M5 for linux-arm-kernel@lists.infradead.org; Fri, 21 Oct 2016 20:34:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-caviumnetworks-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3tlHS9aReeIbXD5dYXUTmpfaHlll8ZWWRaM3JPeVfUw=; b=OvSXbqYYruDhJUwgr0j+PFz0OKVymdhpLJRzA5MB2/yizgsSvgMiDQ8d6z+zErxnRoKbkgqyHl5Qd/tza9Y2O1sxNmpZwDvG3J438LDqZKyqE5GqCn+xsihHvoXwI7YLRqQXooFNy0GalezcGd6XWwaWYcwfpN2tKKZs8Cvoswg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by SN1PR07MB2253.namprd07.prod.outlook.com (10.164.47.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.16; Fri, 21 Oct 2016 20:33:38 +0000 From: Yury Norov To: , , , , , Subject: [PATCH 01/18] 32-bit ABI: introduce ARCH_32BIT_OFF_T config option Date: Fri, 21 Oct 2016 23:33:00 +0300 Message-ID: <1477081997-4770-2-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477081997-4770-1-git-send-email-ynorov@caviumnetworks.com> References: <1477081997-4770-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM3PR03CA049.eurprd03.prod.outlook.com (10.141.191.177) To SN1PR07MB2253.namprd07.prod.outlook.com (10.164.47.147) X-MS-Office365-Filtering-Correlation-Id: 851674af-53b9-4985-6e3a-08d3f9f189e6 X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2253; 2:lrksv/PLt8/P+Iz7x0b8jk+u3fTIKjCMucMpVxUkp5rng5zOgpIVkiCUcwvwGEHFXUOji2uowdN7S072d25L5bjNhYQ23jauZHj8GidQH6QuE9hzakCOPrKXkYOdZFTRyfb6fl+cKb5GS8SHAs2yf/fTmR1a7SPFIAkl1j6ecfVpNH0SMulHCW/BUCuBd8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WYdsM9e1XG6Kk3PrfFPVGWHNppxjH+OMVakjJoG3uEQvGhapkyCGJq/XnjdYo0Dxr+9cHWiC1JWNAYFeYfAoR0iFUMu5ySR8Ai1hNzjPuNJVvJF1PaVbx25rR8E6kRESu4C4zugsQ9wE+QxPQgvAk4NbcFZLHyePyXP/cxIshXo8DjpKlXu12pAMX/P3kfEfkTalcRqVcu8tHp7+s+xpBN3D1f1dI48VOGx9Bh2MzRwEW5QUEYLMuelpS70cMeJdGFywg7eZQzRAOe4zR7x0gEhmIfwbpeYYpFTE9f2vfpWVYdvjsfggQeVz4R4iuBX9JzAykGCFckimlyg5PT7qK5CfRPVZZ+QWXjjCZ/sDhavSy3BXLFtRXQfr5NqcF2gLUsCRx1t96vDPpGWfilf6dZ4d/dcbEddhrI4aMkwLlGiEo3WEiutrzMn59L8LnrBS2urxp8qgH5uvFTBLopEvlaBQlGWQSjW64QMgjYlwXzHz/hDv3LuxyvGBMvT+w3Xd3iscWGNpJFVX2647jy/ZU7xugt+aT46YuZrZwIy5qrvSTc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(5213294742642); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:SN1PR07MB2253; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2253; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2253; 4:6W53TP84kL3yj3jDRUXu6kcEd8tOwucvjPBPgD/Kb2udmoivCoq1bdD6oXigGWUXsFwm/Wxb55Iqy55gNupS/IjKdFZ49ZkuM5H8/zdSnTR5cZLXJV/kTKEENBv0iNdJ2BPsqP5Tz/REploMnlBkDr+kbxC5q97UK8SfNsyVcxA39pxevHyJRT94kbQDxq1Z7YqOeLWMxR74Yfp45zWSAVwmYkUfYfgkFckAiZ6zdZSBl1451hF3wCPQsfSLsll96QJls79PWc4RNproAXRANYEJa2tvx0cvImINfheqFexvwwgyKhbZXZcUVQxgJePZ32zlBE3zKDNnulApyNWu/u5hmR5uE0Z79VGZdT8aCjpsDosuv5PrHqrcYTUjZV3yql9kDT8L0Vq4pLumOrEJ1XH4MHlZ4bN528AklVP7MY/XICBp48zUk6KXLbjSEeV5 X-Forefront-PRVS: 01026E1310 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(50466002)(105586002)(6116002)(5660300001)(33646002)(586003)(3846002)(47776003)(81166006)(92566002)(81156014)(97736004)(2950100002)(7736002)(5001770100001)(305945005)(6666003)(2906002)(4326007)(8676002)(36756003)(19580395003)(77096005)(7846002)(5003940100001)(7416002)(66066001)(229853001)(50986999)(189998001)(42186005)(101416001)(19580405001)(2201001)(68736007)(48376002)(76506005)(106356001)(76176999)(50226002)(15760500001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2253; 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; SN1PR07MB2253; 23:0LOyjB4I08T5hi+03ExbtfPqOshnR6p5LnEgJu+Yl?= Nf9KkoychK7jrOG1JpAHOkYFBbaPOwUPYohsWp9tYKW/b4LdoW1x0yWdvREUku7LBixTXdGJ27H3lNPPDt/wuYDRkOoC9db/cbOYJ1JhKQPjlETc+YS9jRpWYMxYOTOKu8/t4DlN+SE6xTV5CUQwYAopt1uss8ZhwQFxcnq/hDY5EhDNuA0fke8dLiimWvk48OGT5wUKj74DZwe6ZdWSXKlAiIxBt/+cATJqwWfYgn43MjqsTmezkEIpllT0jYKvgM8ZzNVQ0I3PjgbVQJsD0WKNPzoY7W6BGpvIkmv7/34t8X8qfhi4EEXP7y6gIPGhoqfY2xN+9hxPI3po2VDaDDFusQP3aryI5xiaGiAgki6AmW0x56g4BmzSvPKVtgawqX8TYhvUbv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rDHNKpwREjLVo916jCZjN8R14cUHYmEx8mgIv2GZ3oFDGox; 5:HS6/eJo9no+3wJN0fsVvafwses/TuW33LAZxo9pexBBdZS5vZs0VNhPCOw9zutgGQLBO3ESgyf0MnwN+DfjYthj0w0qQrVRSpCee7K/KTDPARpcbPDyihskklBUZsQySJsb31B3vP9Dp5g8c6wUQKOJ3mQIscYtkNCziouqdNBk=; 24:hZ5pxWDgQZS+dEmGjHvP19K+p8TLWf88z+59twBJu+l/8ivFuZoJ6Ro9/HkXJuAu60jCGDnNRjDnbq4VKe6fY03fa9NYSD9vrk6RPZ9BZvQ=; 7:g9tQHKIUwoO2HPh2kQqs/dtH4rQH8/gMcUZ3dubJdcDBnQCF9ZeB0HIMgqZVmp+gmBIy2bngjEXoPk9mDfrGjRBo9RRO8dCPExVyUwseFcta/r9/6qjnU6O8OuOa8QAk1afcvDsYsp6sMrDTdfJBXdpAV9KMC5mF89FAjVXRDMqF5f0Vbi09OsDAfz4+xyD1sUYzfmKI27JubazcveeBfwXUNwuXxM9dezEaFqRpCy8JmOiR+uT84eI+v3W8+ddeRCbalR3EDwkTGtuMOkAt64wK0bINqACFFd1SxMgFNhUsu4tKrN7ilnHET8Cxu9ZiJFUgUlIgexuA8ov6WB8WOCItAR3XbZrHGLp74ziykdQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2016 20:33:38.1763 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2253 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161021_133403_069900_5FF53213 X-CRM114-Status: GOOD ( 11.23 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [104.47.33.49 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [104.47.33.49 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: szabolcs.nagy@arm.com, heiko.carstens@de.ibm.com, cmetcalf@ezchip.com, ynorov@caviumnetworks.com, philipp.tomsich@theobroma-systems.com, joseph@codesourcery.com, zhouchengming1@huawei.com, Prasun.Kapoor@caviumnetworks.com, agraf@suse.de, geert@linux-m68k.org, kilobyte@angband.pl, manuel.montezelo@gmail.com, pinskia@gmail.com, linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, bamvor.zhangjian@huawei.com, maxim.kuvyrkov@linaro.org, Nathan_Lynch@mentor.com, schwidefsky@de.ibm.com, davem@davemloft.net, christoph.muellner@theobroma-systems.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org All new 32-bit architectures should have 64-bit off_t type, but existing architectures has 32-bit ones. To handle it, new config option is added to arch/Kconfig that defaults ARCH_32BIT_OFF_T to be disabled for non-64 bit architectures. All existing 32-bit architectures enable it explicitly here. New option affects force_o_largefile() behaviour. Namely, if off_t is 64-bits long, we have no reason to reject user to open big files. For syscalls sys_openat() and sys_open_by_handle_at() force_o_largefile() is called, to set O_LARGEFILE flag, and this is the only difference comparing to compat versions. All compat ABIs are already turned to use 64-bit off_t, except tile. So, compat versions for this syscalls are not needed anymore. Tile is handled explicitly. Note that even if architectures has only 64-bit off_t in the kernel (arc, c6x, h8300, hexagon, metag, nios2, openrisc, tile32 and unicore32), a libc may use 32-bit off_t, and therefore want to limit the file size to 4GB unless specified differently in the open flags. Signed-off-by: Yury Norov --- arch/Kconfig | 4 ++++ arch/arc/Kconfig | 1 + arch/arm/Kconfig | 1 + arch/blackfin/Kconfig | 1 + arch/cris/Kconfig | 1 + arch/frv/Kconfig | 1 + arch/h8300/Kconfig | 1 + arch/hexagon/Kconfig | 1 + arch/m32r/Kconfig | 1 + arch/m68k/Kconfig | 1 + arch/metag/Kconfig | 1 + arch/microblaze/Kconfig | 1 + arch/mips/Kconfig | 1 + arch/mn10300/Kconfig | 1 + arch/nios2/Kconfig | 1 + arch/openrisc/Kconfig | 1 + arch/parisc/Kconfig | 1 + arch/powerpc/Kconfig | 1 + arch/score/Kconfig | 1 + arch/sh/Kconfig | 1 + arch/sparc/Kconfig | 1 + arch/tile/Kconfig | 1 + arch/tile/kernel/compat.c | 3 +++ arch/unicore32/Kconfig | 1 + arch/x86/Kconfig | 1 + arch/x86/um/Kconfig | 1 + arch/xtensa/Kconfig | 1 + include/linux/fcntl.h | 2 +- include/uapi/asm-generic/unistd.h | 5 ++--- 29 files changed, 35 insertions(+), 4 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/Kconfig b/arch/Kconfig index 659bdd0..ec06a71 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -234,6 +234,10 @@ config ARCH_THREAD_STACK_ALLOCATOR config ARCH_WANTS_DYNAMIC_TASK_STRUCT bool +config ARCH_32BIT_OFF_T + bool + depends on !64BIT + config HAVE_REGS_AND_STACK_ACCESS_API bool help diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index ecd1237..3e8dfd6 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -9,6 +9,7 @@ config ARC def_bool y select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC + select ARCH_32BIT_OFF_T select BUILDTIME_EXTABLE_SORT select CLKSRC_OF select CLONE_BACKWARDS diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index b5d529f..ff8b8b2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1,6 +1,7 @@ config ARM bool default y + select ARCH_32BIT_OFF_T select ARCH_CLOCKSOURCE_DATA select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAS_ELF_RANDOMIZE diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index 3c1bd64..26418e7 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig @@ -12,6 +12,7 @@ config RWSEM_XCHGADD_ALGORITHM config BLACKFIN def_bool y + select ARCH_32BIT_OFF_T select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK select HAVE_DYNAMIC_FTRACE diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 71b758d..8c059f0 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -50,6 +50,7 @@ config LOCKDEP_SUPPORT config CRIS bool default y + select ARCH_32BIT_OFF_T select HAVE_IDE select GENERIC_ATOMIC64 select HAVE_UID16 diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index eefd9a4..2f14904 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig @@ -1,6 +1,7 @@ config FRV bool default y + select ARCH_32BIT_OFF_T select HAVE_IDE select HAVE_ARCH_TRACEHOOK select HAVE_PERF_EVENTS diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 3ae8525..29bbcb1 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -1,5 +1,6 @@ config H8300 def_bool y + select ARCH_32BIT_OFF_T select GENERIC_ATOMIC64 select HAVE_UID16 select VIRT_TO_BUS diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 1941e4b..bbcea8c 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -3,6 +3,7 @@ comment "Linux Kernel Configuration for Hexagon" config HEXAGON def_bool y + select ARCH_32BIT_OFF_T select HAVE_OPROFILE # Other pending projects/to-do items. # select HAVE_REGS_AND_STACK_ACCESS_API diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig index 3cc8498..efa10d3 100644 --- a/arch/m32r/Kconfig +++ b/arch/m32r/Kconfig @@ -1,6 +1,7 @@ config M32R bool default y + select ARCH_32BIT_OFF_T select HAVE_IDE select HAVE_OPROFILE select INIT_ALL_POSSIBLE diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index d140206..ed6f90c 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -1,6 +1,7 @@ config M68K bool default y + select ARCH_32BIT_OFF_T select ARCH_MIGHT_HAVE_PC_PARPORT if ISA select HAVE_IDE select HAVE_AOUT if MMU diff --git a/arch/metag/Kconfig b/arch/metag/Kconfig index 5b7a45d..c337192 100644 --- a/arch/metag/Kconfig +++ b/arch/metag/Kconfig @@ -1,5 +1,6 @@ config METAG def_bool y + select ARCH_32BIT_OFF_T select EMBEDDED select GENERIC_ATOMIC64 select GENERIC_CLOCKEVENTS diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 86f6572..3a6146b 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -1,5 +1,6 @@ config MICROBLAZE def_bool y + select ARCH_32BIT_OFF_T select ARCH_HAS_GCOV_PROFILE_ALL select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_WANT_IPC_PARSE_VERSION diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index b3c5bde..a01da24 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -1,6 +1,7 @@ config MIPS bool default y + select ARCH_32BIT_OFF_T if !64BIT select ARCH_SUPPORTS_UPROBES select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index 38e3494..c44c699 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig @@ -1,6 +1,7 @@ config MN10300 def_bool y select HAVE_EXIT_THREAD + select ARCH_32BIT_OFF_T select HAVE_OPROFILE select HAVE_UID16 select GENERIC_IRQ_SHOW diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig index 51a56c8..f9273c9 100644 --- a/arch/nios2/Kconfig +++ b/arch/nios2/Kconfig @@ -1,5 +1,6 @@ config NIOS2 def_bool y + select ARCH_32BIT_OFF_T select CLKSRC_OF select GENERIC_ATOMIC64 select GENERIC_CLOCKEVENTS diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index 489e7f9..c4c96c9 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -5,6 +5,7 @@ config OPENRISC def_bool y + select ARCH_32BIT_OFF_T select OF select OF_EARLY_FLATTREE select IRQ_DOMAIN diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 71c4a3a..025ae12 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -1,5 +1,6 @@ config PARISC def_bool y + select ARCH_32BIT_OFF_T if !64BIT select ARCH_MIGHT_HAVE_PC_PARPORT select HAVE_IDE select HAVE_OPROFILE diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 65fba4c..22178eb 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -80,6 +80,7 @@ config ARCH_HAS_DMA_SET_COHERENT_MASK config PPC bool default y + select ARCH_32BIT_OFF_T if PPC32 select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO select BINFMT_ELF diff --git a/arch/score/Kconfig b/arch/score/Kconfig index 507d631..0a9484b 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig @@ -2,6 +2,7 @@ menu "Machine selection" config SCORE def_bool y + select ARCH_32BIT_OFF_T select GENERIC_IRQ_SHOW select GENERIC_IOMAP select GENERIC_ATOMIC64 diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index ee08695..1f99eb3 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -56,6 +56,7 @@ config SUPERH config SUPERH32 def_bool ARCH = "sh" + select ARCH_32BIT_OFF_T select HAVE_KPROBES select HAVE_KRETPROBES select HAVE_IOREMAP_PROT if MMU && !X2TLB diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index b23c76b..36ef669 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -46,6 +46,7 @@ config SPARC config SPARC32 def_bool !64BIT + select ARCH_32BIT_OFF_T select GENERIC_ATOMIC64 select CLZ_TAB select HAVE_UID16 diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index 4583c03..845dcbd 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig @@ -3,6 +3,7 @@ config TILE def_bool y + select ARCH_32BIT_OFF_T if !64BIT select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_WANT_FRAME_POINTERS diff --git a/arch/tile/kernel/compat.c b/arch/tile/kernel/compat.c index bdaf71d..b38a898 100644 --- a/arch/tile/kernel/compat.c +++ b/arch/tile/kernel/compat.c @@ -103,6 +103,9 @@ COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned int, offset_high, #define compat_sys_readahead sys32_readahead #define sys_llseek compat_sys_llseek +#define sys_openat compat_sys_openat +#define sys_open_by_handle_at compat_sys_open_by_handle_at + /* Call the assembly trampolines where necessary. */ #define compat_sys_rt_sigreturn _compat_sys_rt_sigreturn #define sys_clone _sys_clone diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index 0769066..cc642f9 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig @@ -1,6 +1,7 @@ config UNICORE32 def_bool y select ARCH_HAS_DEVMEM_IS_ALLOWED + select ARCH_32BIT_OFF_T select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO select HAVE_MEMBLOCK diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index bada636..52d19b4 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -20,6 +20,7 @@ config X86 select ACPI_LEGACY_TABLES_LOOKUP if ACPI select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI select ANON_INODES + select ARCH_32BIT_OFF_T if X86_32 select ARCH_CLOCKSOURCE_DATA select ARCH_DISCARD_MEMBLOCK select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index ed56a1c..8436bcd 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig @@ -21,6 +21,7 @@ config 64BIT config X86_32 def_bool !64BIT select HAVE_AOUT + select ARCH_32BIT_OFF_T select ARCH_WANT_IPC_PARSE_VERSION select MODULES_USE_ELF_REL select CLONE_BACKWARDS diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index f610586..90c062d 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -3,6 +3,7 @@ config ZONE_DMA config XTENSA def_bool y + select ARCH_32BIT_OFF_T select ARCH_WANT_FRAME_POINTERS select ARCH_WANT_IPC_PARSE_VERSION select BUILDTIME_EXTABLE_SORT diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index 76ce329..46960a1 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h @@ -5,7 +5,7 @@ #ifndef force_o_largefile -#define force_o_largefile() (BITS_PER_LONG != 32) +#define force_o_largefile() (!IS_ENABLED(CONFIG_ARCH_32BIT_OFF_T)) #endif #if BITS_PER_LONG == 32 diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 9b1462e..a6062be 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -178,7 +178,7 @@ __SYSCALL(__NR_fchownat, sys_fchownat) #define __NR_fchown 55 __SYSCALL(__NR_fchown, sys_fchown) #define __NR_openat 56 -__SC_COMP(__NR_openat, sys_openat, compat_sys_openat) +__SYSCALL(__NR_openat, sys_openat) #define __NR_close 57 __SYSCALL(__NR_close, sys_close) #define __NR_vhangup 58 @@ -676,8 +676,7 @@ __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark) #define __NR_name_to_handle_at 264 __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) #define __NR_open_by_handle_at 265 -__SC_COMP(__NR_open_by_handle_at, sys_open_by_handle_at, \ - compat_sys_open_by_handle_at) +__SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at) #define __NR_clock_adjtime 266 __SC_COMP(__NR_clock_adjtime, sys_clock_adjtime, compat_sys_clock_adjtime) #define __NR_syncfs 267 From patchwork Fri Oct 21 20:33:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 101641 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1489640qge; Fri, 21 Oct 2016 13:45:28 -0700 (PDT) X-Received: by 10.99.173.75 with SMTP id y11mr4156165pgo.130.1477082728114; Fri, 21 Oct 2016 13:45:28 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id l78si4043706pfi.288.2016.10.21.13.45.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Oct 2016 13:45:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@CAVIUMNETWORKS.onmicrosoft.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxgfm-0004PR-NH; Fri, 21 Oct 2016 20:44:14 +0000 Received: from mail-co1nam03on0076.outbound.protection.outlook.com ([104.47.40.76] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxgYg-000507-Rv for linux-arm-kernel@lists.infradead.org; Fri, 21 Oct 2016 20:37:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-caviumnetworks-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zTGCc01VWWoYIHmqzxRKe12JR/IaSmTX/r4UuUTaBdw=; b=I2FbpV8/bMXNenXTrHx44a2L2xlZEgJqjKo/2noPg68xZKxKe2U/Sh6nsH/R4E3M+h6I5Sr0GvwnkN3cDSB7BZzN8N9QLUAkNqmlzZQGs3/a32v/vqmIK2XEYbDvO4JMib8Vgt8VJxLfW8bFL8n4RE8Di8etX0nB701G3eRB0SU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by CY1PR07MB2246.namprd07.prod.outlook.com (10.164.112.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Fri, 21 Oct 2016 20:36:31 +0000 From: Yury Norov To: , , , , , Subject: [PATCH 16/18] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32 Date: Fri, 21 Oct 2016 23:33:15 +0300 Message-ID: <1477081997-4770-17-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477081997-4770-1-git-send-email-ynorov@caviumnetworks.com> References: <1477081997-4770-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AM4PR0701CA0023.eurprd07.prod.outlook.com (10.165.102.33) To CY1PR07MB2246.namprd07.prod.outlook.com (10.164.112.148) X-MS-Office365-Filtering-Correlation-Id: 0fd0bc66-7a16-4807-216d-08d3f9f1f137 X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2246; 2:Ba3XTtSEhi4PSW105PnV4OKc4dHHNc7OGzGEBKxwf7JdYF7xEhzAl1ZSSGZpfGfZ7qRnehNHgTQD+XSz+KA1zji4Q+Md2KRKk5HiFMMIqBhcxdHV1af600WEEf5/Oq3K/A757etREuslNdb3YwFiEKTnUNAQfIwDqfD9Chz+Va15z2fgK+JP1jkccBiRawA30pRbTla/UjgJuxYvWoOITQ==; 3:JDwgrd/TOstujXy7GeOKCNJEsikRl4lx6CPh10/akLFGnRM9LX5P5DyIYFtkWpAPLWfPcqVxzHavmOUzuRI3BLR+MyQ0gvQxQYIxm73XRrXRxYeKpNKcGXXXT1xf0WtTUhuw5YCKZUVebEs/QGNeDQ==; 25:w9Wci943v+HX3oIArcM+v+FxSxgKaOkyUIh9PC7MROGoOEwQkFuF/7ns03iMwcUqyyGqqvVP48EmAThw9UUBayU5Moyfmlw50Nk2hDiSZzTJUHzaXpgcwet3bobkvqzR+pMOh9C7mPvm4Vlt4jg8tgRsGXhVWm0pQmYKnbPZH1rKplSlXc+mmPvHSXZGs5IjuMdQSrSTbBxhaVARSgJL5iOh1S00q/A7EeaS5ahs+pX1I8R61SnViuPHsWAviMFOTXc0EqTlP3dEWB9o2nVWh/HDNpaR32HbYk4+GTBzpKsAuzxtKUZI67nbRuHefaJPTK0TcsbdH0q43LCJz9Sq3p275QK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QWd9g0U2jB4F+qhweo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(50582790962513); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:CY1PR07MB2246; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2246; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2246; 4:9hm1XEsi5GOqUvMVdzxPb3HnSWdPmUyLeJ9foIUIrr6jIhtwNSfdtL+awrDdrFsauhhc332gkinGw7IFmp18rpD7+WelnrpRyKEC5YGCr3txcSSvnNnuoJG0ZkyDq5rHvjwYCvcWKiTnQecHb4UpjxD5cc/YA4U9hlwfngW+IW94c3qID4DNnlh+2o/DozxQL7zNVakuE/iKF7BblSbKaMwG+EYzNZCCC2b50q4hh0Fb5iaay8rl5XkvHv6+iMmvDEj3slyKZ9g2emkYwhQf8lZkR3+rdm+yULG9BupLB4vZS7AOdTptceKpGo/B0eNQsaw4wRZcBa7TllyrjpZ9KpbMlaRCQvHIrcnC6XiHRkHD2sGfuATSk8yrPKSzr3/hj/8ThS/3sZuHGSaczhD8CmdLUMRrhL6gHJsCL+BZPd03bMlljuSKb1WR3FMbIzJGF1v9vKjnhRs68irbV2gDiQ== X-Forefront-PRVS: 01026E1310 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(199003)(189002)(4326007)(101416001)(6116002)(76176999)(189998001)(50466002)(5890100001)(2906002)(3846002)(47776003)(97736004)(68736007)(105586002)(229853001)(66066001)(106356001)(92566002)(5003940100001)(77096005)(50226002)(5001770100001)(81166006)(76506005)(19580405001)(19580395003)(42186005)(7416002)(2950100002)(7846002)(81156014)(36756003)(586003)(33646002)(2201001)(5660300001)(6666003)(50986999)(305945005)(48376002)(8676002)(7736002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2246; 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; CY1PR07MB2246; 23:avhxne7bbuhgZl0b19R2Toke17d/VtWBd3WhcCGHp?= tzlLZ4JS+Bleq9gGoLJzFcPAEoWNKRnXJEv+6CoTlH+d0iXtPyR/63lBEuJ/0/E/NAuh9DOK6bQGV6t2AK8+AXsTfdv3er6MYL4iTXRXfI76pynlZPPEmGtwcv78J+bTriySgNDaD/W7uyZp58Au8hBLDj/hm1SDhF183PAwLKIaXyJpN0XVUFMtffm2eMRFTRG3/4RqXT4zZFA9vUKN/j5O5k/lcLNsSngYYkPj8DFDDW/HxxrPsspsK3Xzy48Yhzb3STln1LFhAkWbuXAYqS1j+rDZnl4zI0ppeOctR/zss8nkzkCNDNJafVgrpg4z0mBb4xWVmdHDwzvywF7GgjmKqaENRB3WOmUeC033wxKFvhbP/ovCLPwHFnPXf5zOheB8SwVNa6bbd3/kD769hlKM0ma9S71KMcFUvdBZKfg7pfAPjzHHuBahXPkiYN5E5uv5YfeqeM/4mJPimuJl2kjVChTES4XOGToFxaYmDZEvOu2J+q7h9BGSciJiufWEal7rUgRqgUECgWZzKksp9tkYLw9Y6EZVRo19mX+MfG7BGWHO3biiZK9gdVr0Q1NJmDTImTzGYgH9w3WuXzQUIEws57ofuQnIMYyEhJsGAMadkphLNjb1Ky4ZAUKnpFLVGu829SNE6RyzqhtTTvZnVa40a1hp2ECpeRlWL1dGFw8VIo0xlK+3Uj5T4dUIL0FgOkkxdZICHugyQt2RmjIg8EEEmhQD9nB3too4/J7qbx5AizU+iSZ2CcBSLbY5kx8zO8h2OusXwbYtAP87EoE4OpI11JTp4/CVCJL6rS3YUlxm6PF9BeKWc1vBOnB5JVvSvasbg48HwM47wc/JtUVnIq0aomOJ3fZilizGUjVE17eWBRxqltvEMTOOqJhO2EpbLgMkOfY6WbXKZj9JKrwV8oAE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eCo39zAS0ZfL96klGa3y275W3oB2fRNPvkso21mqV6SB4KQB6QC3Xfnr5r/F5dDwwp0mhtdfqZonv5Ryk0koPOh0hxZTfOGeDB7MEauOQWdYREs9JAwNRhbRdJiYod9vhZlo3eiiAV2vscoFYO1W7NiYVCyL77/NjN5GKMcaS3Jb82O8Ywgw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2016 20:36:31.5134 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2246 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161021_133655_591951_B3E25992 X-CRM114-Status: GOOD ( 13.44 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [104.47.40.76 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [104.47.40.76 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: szabolcs.nagy@arm.com, heiko.carstens@de.ibm.com, cmetcalf@ezchip.com, ynorov@caviumnetworks.com, philipp.tomsich@theobroma-systems.com, joseph@codesourcery.com, zhouchengming1@huawei.com, Prasun.Kapoor@caviumnetworks.com, agraf@suse.de, geert@linux-m68k.org, kilobyte@angband.pl, manuel.montezelo@gmail.com, pinskia@gmail.com, linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, bamvor.zhangjian@huawei.com, Bamvor Zhang Jian , maxim.kuvyrkov@linaro.org, Nathan_Lynch@mentor.com, schwidefsky@de.ibm.com, davem@davemloft.net, christoph.muellner@theobroma-systems.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org New aarch32 ptrace syscall handler is introduced to avoid run-time detection of the task type. Signed-off-by: Yury Norov Signed-off-by: Bamvor Zhang Jian Signed-off-by: Chengming Zhou --- arch/arm64/include/asm/unistd32.h | 2 +- arch/arm64/kernel/ptrace.c | 91 ++++++++++++++++++++++++++++++++++++++- arch/arm64/kernel/sys32.c | 1 + include/linux/ptrace.h | 6 +++ kernel/ptrace.c | 10 ++--- 5 files changed, 103 insertions(+), 7 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index b7e8ef1..6da7cbd 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -74,7 +74,7 @@ __SYSCALL(__NR_getuid, sys_getuid16) /* 25 was sys_stime */ __SYSCALL(25, sys_ni_syscall) #define __NR_ptrace 26 -__SYSCALL(__NR_ptrace, compat_sys_ptrace) +__SYSCALL(__NR_ptrace, compat_sys_aarch32_ptrace) /* 27 was sys_alarm */ __SYSCALL(27, sys_ni_syscall) /* 28 was sys_fstat */ diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 1d075ed..ac542c9 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +41,7 @@ #include #include +#include #include #include #include @@ -1215,7 +1217,7 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num, } #endif /* CONFIG_HAVE_HW_BREAKPOINT */ -long compat_arch_ptrace(struct task_struct *child, compat_long_t request, +static long compat_a32_ptrace(struct task_struct *child, compat_long_t request, compat_ulong_t caddr, compat_ulong_t cdata) { unsigned long addr = caddr; @@ -1292,8 +1294,95 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, return ret; } + +COMPAT_SYSCALL_DEFINE4(aarch32_ptrace, compat_long_t, request, compat_long_t, pid, + compat_long_t, addr, compat_long_t, data) +{ + struct task_struct *child; + long ret; + + if (request == PTRACE_TRACEME) { + ret = ptrace_traceme(); + goto out; + } + + child = ptrace_get_task_struct(pid); + if (IS_ERR(child)) { + ret = PTR_ERR(child); + goto out; + } + + if (request == PTRACE_ATTACH || request == PTRACE_SEIZE) { + ret = ptrace_attach(child, request, addr, data); + goto out_put_task_struct; + } + + ret = ptrace_check_attach(child, request == PTRACE_KILL || + request == PTRACE_INTERRUPT); + if (!ret) { + ret = compat_a32_ptrace(child, request, addr, data); + if (ret || request != PTRACE_DETACH) + ptrace_unfreeze_traced(child); + } + + out_put_task_struct: + put_task_struct(child); + out: + return ret; +} + #endif /* CONFIG_AARCH32_EL0 */ +#ifdef CONFIG_ARM64_ILP32 + +long compat_arch_ptrace(struct task_struct *child, compat_long_t request, + compat_ulong_t caddr, compat_ulong_t cdata) +{ + sigset_t new_set; + + switch (request) { + case PTRACE_GETSIGMASK: + if (caddr != sizeof(compat_sigset_t)) + return -EINVAL; + + return put_sigset_t((compat_sigset_t __user *) (u64) cdata, + &child->blocked); + + case PTRACE_SETSIGMASK: + if (caddr != sizeof(compat_sigset_t)) + return -EINVAL; + + if (get_sigset_t(&new_set, (compat_sigset_t __user *) (u64) cdata)) + return -EFAULT; + + sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP)); + + /* + * Every thread does recalc_sigpending() after resume, so + * retarget_shared_pending() and recalc_sigpending() are not + * called here. + */ + spin_lock_irq(&child->sighand->siglock); + child->blocked = new_set; + spin_unlock_irq(&child->sighand->siglock); + + return 0; + + default: + return compat_ptrace_request(child, request, caddr, cdata); + } +} + +#elif defined(CONFIG_COMPAT) + +long compat_arch_ptrace(struct task_struct *child, compat_long_t request, + compat_ulong_t caddr, compat_ulong_t cdata) +{ + return 0; +} + +#endif + const struct user_regset_view *task_user_regset_view(struct task_struct *task) { #ifdef CONFIG_AARCH32_EL0 diff --git a/arch/arm64/kernel/sys32.c b/arch/arm64/kernel/sys32.c index a40b134..3752443 100644 --- a/arch/arm64/kernel/sys32.c +++ b/arch/arm64/kernel/sys32.c @@ -38,6 +38,7 @@ asmlinkage long compat_sys_fadvise64_64_wrapper(void); asmlinkage long compat_sys_sync_file_range2_wrapper(void); asmlinkage long compat_sys_fallocate_wrapper(void); asmlinkage long compat_sys_mmap2_wrapper(void); +asmlinkage long compat_sys_aarch32_ptrace(void); #undef __SYSCALL #define __SYSCALL(nr, sym) [nr] = sym, diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 504c98a..75887a0 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -97,6 +97,12 @@ int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr, unsigned long data); int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, unsigned long data); +int ptrace_traceme(void); +struct task_struct *ptrace_get_task_struct(pid_t pid); +int ptrace_attach(struct task_struct *task, long request, + unsigned long addr, unsigned long flags); +int ptrace_check_attach(struct task_struct *child, bool ignore_state); +void ptrace_unfreeze_traced(struct task_struct *task); /** * ptrace_parent - return the task that is tracing the given task diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 2a99027..5638880 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -138,7 +138,7 @@ static bool ptrace_freeze_traced(struct task_struct *task) return ret; } -static void ptrace_unfreeze_traced(struct task_struct *task) +void ptrace_unfreeze_traced(struct task_struct *task) { if (task->state != __TASK_TRACED) return; @@ -170,7 +170,7 @@ static void ptrace_unfreeze_traced(struct task_struct *task) * RETURNS: * 0 on success, -ESRCH if %child is not ready. */ -static int ptrace_check_attach(struct task_struct *child, bool ignore_state) +int ptrace_check_attach(struct task_struct *child, bool ignore_state) { int ret = -ESRCH; @@ -294,7 +294,7 @@ bool ptrace_may_access(struct task_struct *task, unsigned int mode) return !err; } -static int ptrace_attach(struct task_struct *task, long request, +int ptrace_attach(struct task_struct *task, long request, unsigned long addr, unsigned long flags) { @@ -408,7 +408,7 @@ static int ptrace_attach(struct task_struct *task, long request, * Performs checks and sets PT_PTRACED. * Should be used by all ptrace implementations for PTRACE_TRACEME. */ -static int ptrace_traceme(void) +int ptrace_traceme(void) { int ret = -EPERM; @@ -1057,7 +1057,7 @@ int ptrace_request(struct task_struct *child, long request, return ret; } -static struct task_struct *ptrace_get_task_struct(pid_t pid) +struct task_struct *ptrace_get_task_struct(pid_t pid) { struct task_struct *child;