Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964942AbcJVMO0 (ORCPT ); Sat, 22 Oct 2016 08:14:26 -0400 Received: from mail-sn1nam02on0073.outbound.protection.outlook.com ([104.47.36.73]:48993 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754493AbcJVMOW (ORCPT ); Sat, 22 Oct 2016 08:14:22 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: Arnd Bergmann , James Hogan , CC: Yury Norov , Vineet Gupta , Catalin Marinas , Will Deacon , Mark Salter , Aurelien Jacquiot , Yoshinori Sato , Richard Kuo , Ley Foon Tan , Jonas Bonn , Chen Liqin , Lennox Wu , Chris Metcalf , Guan Xuetao , Andrew Pinski , , , , , , , , Subject: [PATCH] asm-generic: Drop getrlimit and setrlimit syscalls from default list Date: Sat, 22 Oct 2016 15:14:04 +0300 Message-ID: <1477138444-14993-1-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: VI1PR0901CA0050.eurprd09.prod.outlook.com (10.167.203.146) To CY1PR07MB2247.namprd07.prod.outlook.com (10.164.112.149) X-MS-Office365-Filtering-Correlation-Id: c3c7b315-79e7-4077-56b8-08d3fa74f2bb X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2247;2:K2Y/M8ookcLIKg972JzQvbNEEsIVPlihk8/3OnM4WNf47oDpYtju8/DdyuzJQXb5569GhjEX3onsChZbMPr4ll8B+ptkN/QiJuHjdagsfOEzMFEoM8JS1lVKHmvtiT1XfD55gEUv4J82QWfDIbgKHWTow7cMnTRl1vEEbKbpRWBDxWx2i8gL6R5DzOeCGFrdw3iCCgfIbLTLo40lxEk53Q==;3:/QCdJ2qlIwcLolqaqian8+uil4CZzG6dZYp0Z1A+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wPJC6fd3RCMfmP98sXD2w14FV5ElFcmMGYQUz+k4wYvsRPEzSQpX+tSv3k6Xcx2fI1xNctaMpCfWyWwI4oghM0+IRGLPj4f4KVRxifsQrWC21SwduBxwHZ4Fl/3NEAp9mfZpt3SaTZChv/Jjuo5cII2NC5JzwWbZr7SBsa5+HaTqVmT7JZkoDyWyH5JcUAJMIv8XgHXHtCnEuwQG91Vcs404A6xglI3sD14UMFm0p/+FMfoDpf3LkShx3NeS6Iik7AOysFllVF7bGwjxkR+TSzqI0wb43VDIOObJFKMnYkMQhDi16Pf4yECR0chkJFYxJ5PnkefRsCBAbypV1Lmy9VH/2OhjK8quu6yLmDiO3dWs08pHtTUoqG1CN0lG0nfJRwk+I0k94tGy4AMkfHGxzMUIEgLGNtWNqTjkW8KXDZHwcaWJgfVOZ6BElmE9Cd6sHqBWDPZ96Djkk/ryYLUI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(31051911155226)(9452136761055)(80048183373757)(258649278758335); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:CY1PR07MB2247;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2247; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2247;4:+Pjj2hLBe23rCEgJgiCXuO8Va+3FN/BANYGoMEeIMd+kyBDYNJ/Muts/njBJao7C7uaeBoU8higGcV6VyPQtlveouTIayz4uHABsDg9TYhgGH9okdlwVSxCKZC8aXOP3taLQc4qooJfRWeR7qvfWmWyHkLWa74rKpXVOFX3IgkqPvilxLDj/+uIXMpxn1TyuvbRyi9QtisK8zUk5p4NPFy6zYJZRHqwuu/st5cfWPTsjUViUGMJ+KVkp23JJhufLYDH1uakvifUiPdZq+pAebKlOliwrQ12Z89qYq78gMTElE33fvF+HlxJPH69QPCS2qpzpSKXLOylq6Au0lBJVIpJEWEWALfgshj/FT0rZwqYF+BUB06nykX7+Y11v4+JOmLSWWtgXmEaK9lzbxBKc5FOcwdJYrl8GZlY/P5KLxwDxed+zdYbr0CyK1bqo/1fuNlHfyP/GtiRKAwPjIy/Lm+FIPAP80gaHg7ojIAxkUkWYzglE4L5svMZBoMfj/g9ULDHQw7gcWcA010OVLxFA8fa/loQ5zcf/hfRs+HSk5QVa8BCl6cjeB6fSIb1Y6mtoaCDx5W3Yt3uZhgQlYOsB8g== X-Forefront-PRVS: 01039C93E4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(101416001)(97736004)(5001770100001)(6116002)(3846002)(68736007)(189998001)(106356001)(5003940100001)(105586002)(76506005)(42186005)(586003)(50986999)(229853001)(77096005)(36756003)(47776003)(7846002)(81156014)(19580395003)(19580405001)(7736002)(575784001)(81166006)(8666005)(8676002)(92566002)(305945005)(33646002)(48376002)(50466002)(5660300001)(6666003)(2906002)(50226002)(7416002)(66066001)(4326007)(7059030)(41533002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2247;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2247;23:uqpLZdP0plUH64ednhcw4mYeZkeFUWVYOEt8fPr8N?= =?us-ascii?Q?lf8KxAlO5qAWdRG3G+H83T2XYjyH7lDhFOyGeUEgLY8sk68hRrs1oAfm4RkI?= =?us-ascii?Q?/Ad0COGWh/zwuPTeKaHcf1e1aIAV6VlNMGK+pqqxkaUoxdvf+mIeGVuBpY2d?= =?us-ascii?Q?uXrGwLlL4NK/FY0/2jzjilAF0ha6saIJvukxO7SVFBQuhHPd14TgJCXy3szF?= =?us-ascii?Q?i6plDqLOv/e3qDsFag6FXysF1onEDNjwYaWrg3Gqasw4agO2Srh7CEj44rLP?= =?us-ascii?Q?MswyWlkSrn6IK0nJDm2ZwcYqyNYsmV8K7BptanBpK4TZkj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works.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2016 12:14:18.0372 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2247 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7277 Lines: 204 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. Cc: Vineet Gupta Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Salter Cc: Aurelien Jacquiot Cc: Yoshinori Sato Cc: Richard Kuo Cc: James Hogan Cc: Ley Foon Tan Cc: Jonas Bonn Cc: Chen Liqin Cc: Lennox Wu Cc: Chris Metcalf Cc: Guan Xuetao Cc: Arnd Bergmann Cc: Andrew Pinski Cc: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-c6x-dev@linux-c6x.org Cc: uclinux-h8-devel@lists.sourceforge.jp Cc: linux-hexagon@vger.kernel.org Cc: linux-metag@vger.kernel.org Cc: nios2-dev@lists.rocketboards.org Cc: linux-arch@vger.kernel.or Signed-off-by: Yury Norov --- 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 +++++ 12 files changed, 16 insertions(+) diff --git a/arch/arc/include/uapi/asm/unistd.h b/arch/arc/include/uapi/asm/unistd.h index 41fa2ec..928546d 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 043d17a..48355a6 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 12d73d9..f676231 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 7dd20ef..2f98394 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 2151760..52d585c 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 459b6ec..16b5cb3 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 51a32c7..b0dda4d 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 471905b..6812d81 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 d4008c3..7ad1bdc 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 24e9187..cf0505f 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 1f63c47..ef25aec 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 /* Use the standard ABI for syscalls. */ #include diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 9b1462e..bbaeac0 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -465,10 +465,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 -- 2.7.4