Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966383AbdIYVBc (ORCPT ); Mon, 25 Sep 2017 17:01:32 -0400 Received: from mail-co1nam03on0068.outbound.protection.outlook.com ([104.47.40.68]:28576 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964935AbdIYVB1 (ORCPT ); Mon, 25 Sep 2017 17:01:27 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; From: Yury Norov To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Catalin Marinas , Arnd Bergmann Subject: [PATCH 3/3] asm-generic: Drop getrlimit and setrlimit syscalls from default list Date: Tue, 26 Sep 2017 00:00:35 +0300 Message-Id: <20170925210035.31514-4-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170925210035.31514-1-ynorov@caviumnetworks.com> References: <20170925210035.31514-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [176.59.116.181] X-ClientProxiedBy: DB6PR0801CA0050.eurprd08.prod.outlook.com (2603:10a6:4:2b::18) To SN4PR0701MB3838.namprd07.prod.outlook.com (2603:10b6:803:4f::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b10ce209-e8cd-4852-fee6-08d504589579 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:SN4PR0701MB3838; X-Microsoft-Exchange-Diagnostics: 1;SN4PR0701MB3838;3:Tkl5GYRmc4xkY5Kb6kfY8ac5gZ7hrhxSrYX4kiSQaC6hA8g7M0qmATOGGritt+OYp9irO4IWk14ERPc7hGT7EbXvoUhYTTKyBTKv7jQoYQEsaneC3cw+OEeIbbE9qsPn/U0MUlyvoboiZZtY3DrtHVermTE7PzI9GF2s814J3NP+F2YAdYpKC8/P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SX4dZPtx0XkuKuogUkvWiqckvZww9AqrtR/vPFiSCHHyGcdBtrEQ3fvcwF/DRAkhQt45oB3QOrWKaLURvu+tNMVA7tt+CKA7LE4ncfBPocjC0hU4yU0FHnNgmlFE0BPVJ2v3or8lS3r/FS/mwtZy9suOgzBBx3s0KxP1VqJHYAyTtm9N91P8gHMkt57LTslTKAIaqqfi1pJTte6wp+SraQ+RW9oL+nX4yc7wgwQy0Nm5V8JUvmTd8vua8H+eZsRxmRwaJpcgiz+oNPo= X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(80048183373757); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3002001)(100000703101)(100105400095)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN4PR0701MB3838;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN4PR0701MB3838; X-Microsoft-Exchange-Diagnostics: 1;SN4PR0701MB3838;4:dI/SfFaEiQHKwYAmhNHqS60yXYy+fMkHoaOVyblNjMyABqTmjuseZOwhIERyZ1s3W6f1WCnT7ihZa6u+mfeNM3Zth9ckAZhubYHP8dPMnQ6Fqqx9eyT93pqQS0idSkV5yBblSq1CEhF6m57A82zBFPeKraruvMowadM1QdGy5TSrVZO34KC7xgkpFhqgon2yIj0NwTZM9djargLf1IryCDh7FRhIX8LsCd3URYTs5vIpD9lpebj/tV6WYZTGlHHkXshqgFhzC+7RDz9mckDgQ4FCk9F72kbzXthm4HYZ26Fc2KVT8lpRbUu44U2H4zz5Tf7WTO/VXgHkf7IacsWdRg== X-Forefront-PRVS: 04410E544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(6009001)(376002)(346002)(189002)(199003)(76506005)(68736007)(16586007)(47776003)(5003940100001)(66066001)(3846002)(101416001)(7736002)(6116002)(1076002)(50986999)(25786009)(305945005)(6666003)(6496005)(72206003)(76176999)(189998001)(50466002)(2906002)(97736004)(36756003)(478600001)(6486002)(110136005)(8936002)(53936002)(5660300001)(42882006)(2950100002)(50226002)(316002)(33646002)(16526017)(81156014)(81166006)(575784001)(106356001)(8676002)(105586002)(48376002)(41533002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN4PR0701MB3838;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN4PR0701MB3838;23:G+YLpxnZ+19xpN6+6oaFuTL663/5Qi8ybHcOPXI?= =?us-ascii?Q?BzqkZhmADoFJNxAuctS5FdgqutbfPF4C60zYQB+z7LbQ0bCM6h/+3TCuJEHv?= =?us-ascii?Q?JY5jJCQEzA760nAXV1EwDPSteLNbyUthsmgLtO9As2b0+diPdB1bsJ74sBRH?= =?us-ascii?Q?H6qJFJeqFw89Ftg3T1MTn3agUNyBOxgteH8cMt9E79cDf43Q2P7qgF1eOGDW?= =?us-ascii?Q?O/3dEHPLg/Ri9NF8gbYraTK2FahJ8czk6zlYNo9ByiRS0DoaifosxWM5OpD8?= =?us-ascii?Q?q0Pr4uM/ESzygSLmUVgnynRlmxw+SQ5UKWwP6/d9nZz/j+KgMvY72ap5XGUN?= =?us-ascii?Q?RscP9uyI/lT5wkrJQQv7d4CC8VW2j0iQ+Xs6slK5P+qSvrzENLvn4eVw4GZB?= =?us-ascii?Q?bmmUoowm1Pfkq+4lYdAp2zo5XC2N+tUyaYRCLNl4YZ16JBrluqitQuMUirGI?= =?us-ascii?Q?Izi9v+yFPJYnFdL0gEDUe4+oFzj+p9t4WE3hXPBC3BXiEAq/9NDAeSOZ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23R9qlhaTs39J6A2tbblRrAsVAAYVMWwaXyYiBafUGSEBcGuYnroJ7DUbW4fCUSJgAt9FUHaBTGlrBFqcdiTzT2+eIeNQ8aL5ko/ma5dEpBEig3C3Xync7Vo5JYauu+D61jA==;5:Qw6ypsrbg2ILAfVNYNHNitZWOkl59S/yl4TNdSjCcNVHSH5sY4lI/G9YJQheNKDTnmVgjATwuWoNT9HHQVAXwCEl/kj5AD9UTQr/lkv4Ib/odyvKH79K/zQ6SYiSmnw8AXfjz0KEFVByaUxQlJ/lPg==;24:AjnD0M01m0H+1sGWP83+iJrLOQL70JjlNi0MTO5CXkkW/vMTXT88QON2Op84IW/V2GKflSbIbRFqZWPfp9G/7HuVUsG8ol56GpCO33cKdX4=;7:3zG+aWN4Lro7blo2t3snWqQXDfPtYuy4gvkitCyK7xfR4kkDIBMgiNOIPkEeCJxv4aLtbeIlWLxOiNN35mTWq7suJLKNkfCuoDA/1pZUtAivI33M2cKzMzev6fHgTuOWj+fkhKASDhD4lHsZ6GAqpBq7E59VZWnDlzumg598eJiD8UOhqWmskt0xZE3xycsNZCsCkyRzBaHS4FkHPddaOPrQ+6we+YEppmsgpXxiwWY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2017 21:01:24.8601 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0701MB3838 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7273 Lines: 202 The newer prlimit64 syscall provides all the functionality provided by the getrlimit and setrlimit syscalls and adds the pid of target process, so future architectures won't need to include getrlimit and setrlimit. Therefore drop getrlimit and setrlimit syscalls from the generic syscall list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the architecture's unistd.h prior to including asm-generic/unistd.h, and adjust all architectures using the generic syscall list to define it so that no in-tree architectures are affected. Signed-off-by: Yury Norov Acked-by: Arnd Bergmann Acked-by: Mark Salter [c6x] Acked-by: James Hogan [metag] Acked-by: Ley Foon Tan [nios2] Acked-by: Stafford Horne [openrisc] Acked-by: Will Deacon [arm64] Acked-by: Vineet Gupta #arch/arc bits --- arch/arc/include/uapi/asm/unistd.h | 1 + arch/arm64/include/uapi/asm/unistd.h | 1 + arch/c6x/include/uapi/asm/unistd.h | 1 + arch/h8300/include/uapi/asm/unistd.h | 1 + arch/hexagon/include/uapi/asm/unistd.h | 1 + arch/metag/include/uapi/asm/unistd.h | 1 + arch/nios2/include/uapi/asm/unistd.h | 1 + arch/openrisc/include/uapi/asm/unistd.h | 1 + arch/score/include/uapi/asm/unistd.h | 1 + arch/tile/include/uapi/asm/unistd.h | 1 + arch/unicore32/include/uapi/asm/unistd.h | 1 + include/uapi/asm-generic/unistd.h | 5 +++++ scripts/checksyscalls.sh | 5 +++++ 13 files changed, 21 insertions(+) diff --git a/arch/arc/include/uapi/asm/unistd.h b/arch/arc/include/uapi/asm/unistd.h index 9a34136d84b2..ac6496527ad6 100644 --- a/arch/arc/include/uapi/asm/unistd.h +++ b/arch/arc/include/uapi/asm/unistd.h @@ -16,6 +16,7 @@ #define _UAPI_ASM_ARC_UNISTD_H #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT #define __ARCH_WANT_SYS_EXECVE #define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_VFORK diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h index 043d17a21342..48355a683e25 100644 --- a/arch/arm64/include/uapi/asm/unistd.h +++ b/arch/arm64/include/uapi/asm/unistd.h @@ -15,5 +15,6 @@ */ #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT #include diff --git a/arch/c6x/include/uapi/asm/unistd.h b/arch/c6x/include/uapi/asm/unistd.h index 12d73d9d81f5..f67623137853 100644 --- a/arch/c6x/include/uapi/asm/unistd.h +++ b/arch/c6x/include/uapi/asm/unistd.h @@ -15,6 +15,7 @@ */ #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT #define __ARCH_WANT_SYS_CLONE /* Use the standard ABI for syscalls. */ diff --git a/arch/h8300/include/uapi/asm/unistd.h b/arch/h8300/include/uapi/asm/unistd.h index 7dd20ef7625a..2f98394b77d4 100644 --- a/arch/h8300/include/uapi/asm/unistd.h +++ b/arch/h8300/include/uapi/asm/unistd.h @@ -1,5 +1,6 @@ #define __ARCH_NOMMU #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT #include diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h index 21517600432b..52d585c5cdb2 100644 --- a/arch/hexagon/include/uapi/asm/unistd.h +++ b/arch/hexagon/include/uapi/asm/unistd.h @@ -28,6 +28,7 @@ #define sys_mmap2 sys_mmap_pgoff #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT #define __ARCH_WANT_SYS_EXECVE #define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_VFORK diff --git a/arch/metag/include/uapi/asm/unistd.h b/arch/metag/include/uapi/asm/unistd.h index 459b6ec15848..16b5cb32ec21 100644 --- a/arch/metag/include/uapi/asm/unistd.h +++ b/arch/metag/include/uapi/asm/unistd.h @@ -8,6 +8,7 @@ */ #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT /* Use the standard ABI for syscalls. */ #include diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h index 51a32c71ce2b..b0dda4de2bc7 100644 --- a/arch/nios2/include/uapi/asm/unistd.h +++ b/arch/nios2/include/uapi/asm/unistd.h @@ -18,6 +18,7 @@ #define sys_mmap2 sys_mmap_pgoff #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT /* Use the standard ABI for syscalls */ #include diff --git a/arch/openrisc/include/uapi/asm/unistd.h b/arch/openrisc/include/uapi/asm/unistd.h index 471905bd7745..6812d81b3c6c 100644 --- a/arch/openrisc/include/uapi/asm/unistd.h +++ b/arch/openrisc/include/uapi/asm/unistd.h @@ -21,6 +21,7 @@ #define sys_mmap2 sys_mmap_pgoff #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT #define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_CLONE diff --git a/arch/score/include/uapi/asm/unistd.h b/arch/score/include/uapi/asm/unistd.h index d4008c339e89..7ad1bdcb8615 100644 --- a/arch/score/include/uapi/asm/unistd.h +++ b/arch/score/include/uapi/asm/unistd.h @@ -1,6 +1,7 @@ #define __ARCH_HAVE_MMU #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT #define __ARCH_WANT_SYSCALL_NO_AT #define __ARCH_WANT_SYSCALL_NO_FLAGS #define __ARCH_WANT_SYSCALL_OFF_T diff --git a/arch/tile/include/uapi/asm/unistd.h b/arch/tile/include/uapi/asm/unistd.h index 24e9187e85a8..cf0505fe4b9c 100644 --- a/arch/tile/include/uapi/asm/unistd.h +++ b/arch/tile/include/uapi/asm/unistd.h @@ -13,6 +13,7 @@ */ #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT #if !defined(__LP64__) || defined(__SYSCALL_COMPAT) /* Use the flavor of this syscall that matches the 32-bit API better. */ #define __ARCH_WANT_SYNC_FILE_RANGE2 diff --git a/arch/unicore32/include/uapi/asm/unistd.h b/arch/unicore32/include/uapi/asm/unistd.h index 9cf71c7bedb1..76ece524ab70 100644 --- a/arch/unicore32/include/uapi/asm/unistd.h +++ b/arch/unicore32/include/uapi/asm/unistd.h @@ -11,6 +11,7 @@ */ #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_SET_GET_RLIMIT #ifndef CONFIG_UNICORE32_OLDABI diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 429dd335def6..ef90d53ac9b6 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -464,10 +464,15 @@ __SYSCALL(__NR_uname, sys_newuname) __SYSCALL(__NR_sethostname, sys_sethostname) #define __NR_setdomainname 162 __SYSCALL(__NR_setdomainname, sys_setdomainname) + +#ifdef __ARCH_WANT_SET_GET_RLIMIT +/* getrlimit and setrlimit are superseded with prlimit64 */ #define __NR_getrlimit 163 __SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit) #define __NR_setrlimit 164 __SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit) +#endif + #define __NR_getrusage 165 __SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage) #define __NR_umask 166 diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh index 5a387a264201..566275e64274 100755 --- a/scripts/checksyscalls.sh +++ b/scripts/checksyscalls.sh @@ -37,6 +37,11 @@ cat << EOF #define __IGNORE_lstat64 /* fstatat64 */ #endif +#ifndef __ARCH_WANT_SET_GET_RLIMIT +#define __IGNORE_getrlimit /* getrlimit */ +#define __IGNORE_setrlimit /* setrlimit */ +#endif + /* Missing flags argument */ #define __IGNORE_renameat /* renameat2 */ -- 2.11.0