From patchwork Wed Apr 25 16:02:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134348 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1050092lji; Wed, 25 Apr 2018 09:04:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/2ekGig+jiOwwUZU1FEg2xYGSPNQeFjv3ndMdrTlOgXArxTY4fWpjscmTp3ufAOkOwirB2 X-Received: by 10.99.178.83 with SMTP id t19mr24654163pgo.212.1524672280192; Wed, 25 Apr 2018 09:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524672280; cv=none; d=google.com; s=arc-20160816; b=sG1XZafZmzXI0FQwFFRqkxLhHIKgQ6oy2rVeQ93blRVjdsMeWFqnXqikG/lmjSM+zE uqqGLQMDY/xgxhAoPqk2oTw9AeOjV1nu/XBdToa5Do66JEnbsCD2wUSK0Bk4hclw7+rf gn8t3dvdcJDGmdRZCJsBVWkurfQ2U7DmqSqvtjox1HLUXa+K4ZsULLD9CmprzWyZ/LLg Wu1ugqFqO0lGkCJPA9cnbLPsRPMM7zzcudXdRq8iD+3DL/yaa/dZSUtKL82ayPKB9CG4 QV5j2xZqEwTKeFkMi+gw+ZXxwFg5DKAnkz441KKwi54u0CEreUsxMqVHXot/HRFCk/Cn z1uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=T4Vg73iJqa43fgAAzk4HBFJySPiVT+uMtLfqGj3WTaM=; b=wcjRBIKQDuY5cuMMSnw1ge274hF45WusUTLttMq5rB6xnI7XkQRnfPo5cQ/Z16581z 3ey1h3GtqjHn6YuHDopLOVeVTa0cZIPCsBq24KpDEhZfL9XOGyCuE7hqCvYSfvoUQACy TIweZ09M4dGuwYbbmsyIrquzx6Hh7PSrg8ACfI88Bw05CutUbd0+Ky0+TKAg5wd2xpXy cCtpaaxoK92DLNfbfPuwDdilOoftKSbiz+kMxGkc9dMaxtHBIK2C83GmWkufhtVzuAW4 HMPU2RWQVLgU0QaQFdF9QBroGWUxwzLAzh0RraBQ4JbIwZTVK2K+Vez0V2k/x0pMSnrs 9umg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=jOKmGiyH; spf=pass (google.com: domain of libc-alpha-return-91840-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91840-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id x10-v6si17194204plm.5.2018.04.25.09.04.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 09:04:40 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91840-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=jOKmGiyH; spf=pass (google.com: domain of libc-alpha-return-91840-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91840-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=tPwW7h9XC0dWIJtIqs3kzXzLQ/1Lb9r L+TUBuQ8dIEhk7z/CFHYME7Nx2uGmnhZ/1dNMVVbjqsNKVNhnVSQ93Me4aq9Cm8J liWUpkwxZHvqVek5gq1WvxHH4HeZCf/6VK8wsqiR/asVg46XdPN8oc6YXKTrBf6M pE554oajaWck= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=WCxhSSVUZJ1vI9TfIrdbQIQZaB8=; b=jOKmG iyHsIdhfo4VhLLqABKJ6l0XCfincIh891M3DEksM7RnNOXC9jcn0p0rFQVtmz3Ar liS5PqQTSIcwtLruKVYqQppnbHkvuj0A8DeoFUgyoYgBuLvOaeBiL07j2VLT+1om UR0MmcNHyrj8htAxmS7MKVMZBcyHIfItHmBc1w= Received: (qmail 56320 invoked by alias); 25 Apr 2018 16:04:28 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 56116 invoked by uid 89); 25 Apr 2018 16:04:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=backwards X-HELO: mout.kundenserver.de From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, netdev@vger.kernel.org, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, albert.aribaud@3adev.fr, Peter Zijlstra , Darren Hart , "Eric W. Biederman" , Dominik Brodowski Subject: [PATCH 03/17] y2038: Remove stat64 family from default syscall set Date: Wed, 25 Apr 2018 18:02:57 +0200 Message-Id: <20180425160311.2718314-4-arnd@arndb.de> In-Reply-To: <20180425160311.2718314-1-arnd@arndb.de> References: <20180425160311.2718314-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:7uiQpXHC848=:mBxjrN0EXu38QOlmHaaN7a NxwMLu/9I44+PdkuAPpu1/d7A0UOFxHkDv0eA5PH64E87aGsknKcPulT0Sd7DDU7j8Dz7IN+x O5e3KM0YB4+oCzDfbxCj8gUfJhyuP284y2ay3Qt4UR4gpq92onmcjlkZ5HM4HqG+nqSVspSUY DVHr2ABKX8niumES+QCMbnWthIUJOpOOh67jdrgYUZDe7eH9E2CaBZ4RF7+2UY88B4ZEhWLmf rnreuerQX5jpScKnXcOUCCpd8Oqo89/4cvsD9EZOr/n2Skg3bK9LANzAZ/4Y9UHs77Ed8eOGJ /aAbKsKY8bXgMxU6IfIL+n0F8vsaXnp7wqPMhj6lPy7O8sb4CXAZAuGnOLxags7kcA3ayCwae KyXUiQuNl0nOTfJzFCyoGa+jiIYL9CWEKSRF+4jWc6DIFMLzkLP/hR/z22oX0EjeTCGLSYKms KhNXjWGaPuFwheoio1/W2X/uF9AgJ8xTAm7vURlwp6NryYcYm9bFXeKik2uKBe3S9yIc1YLZz 5R7tWbnMZ5BQMrKSNkcpceNp75WNX9bIrR5fljpN29dBBT5BuhrFL5Kf/bFgUZsu+yY2QoISy eUynAlXAuIctili0Kn3PS7uja87S7dUDzF9XuGw0CVvxkoruF0DF5e3EFZ+rHsZQ0BWyiFUmu DlnD1VwC/aQOxZFJkRsNa5VE6xvAwfEaUNDFVtDMuL2DE3zavONviF0fohv+wGATqdew= New architectures should no longer need stat64, which is not y2038 safe and has been replaced by statx(). This removes the 'select __ARCH_WANT_STAT64' statement from asm-generic/unistd.h and instead moves it into the respective asm/unistd.h UAPI header files for each architecture that uses it today. In the generic file, the system call number and entry points are now made conditional, so newly added architectures (e.g. riscv32 or csky) will never need to carry backwards compatiblity for it. arm64 is the only 64-bit architecture using the asm-generic/unistd.h file, and it already sets __ARCH_WANT_NEW_STAT in its headers, and I use the same #ifdef here: future 64-bit architectures therefore won't see newstat or stat64 any more. They don't suffer from the y2038 time_t overflow, but for consistency it seems best to also let them use statx(). Signed-off-by: Arnd Bergmann --- arch/arc/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/nds32/include/uapi/asm/unistd.h | 1 + arch/nios2/include/uapi/asm/unistd.h | 1 + arch/openrisc/include/uapi/asm/unistd.h | 1 + arch/unicore32/include/uapi/asm/unistd.h | 1 + include/asm-generic/unistd.h | 1 - include/uapi/asm-generic/unistd.h | 2 ++ 10 files changed, 10 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/arch/arc/include/uapi/asm/unistd.h b/arch/arc/include/uapi/asm/unistd.h index 517178b1daef..3b3543fd151c 100644 --- a/arch/arc/include/uapi/asm/unistd.h +++ b/arch/arc/include/uapi/asm/unistd.h @@ -17,6 +17,7 @@ #define _UAPI_ASM_ARC_UNISTD_H #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_EXECVE #define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_VFORK diff --git a/arch/c6x/include/uapi/asm/unistd.h b/arch/c6x/include/uapi/asm/unistd.h index 0d2daf7f9809..6b2fe792de9d 100644 --- a/arch/c6x/include/uapi/asm/unistd.h +++ b/arch/c6x/include/uapi/asm/unistd.h @@ -16,6 +16,7 @@ */ #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 #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..628195823816 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_STAT64 #include diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h index ea181e79162e..c91ca7d02461 100644 --- a/arch/hexagon/include/uapi/asm/unistd.h +++ b/arch/hexagon/include/uapi/asm/unistd.h @@ -29,6 +29,7 @@ #define sys_mmap2 sys_mmap_pgoff #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_EXECVE #define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_VFORK diff --git a/arch/nds32/include/uapi/asm/unistd.h b/arch/nds32/include/uapi/asm/unistd.h index 6e95901cabe3..603e826e0449 100644 --- a/arch/nds32/include/uapi/asm/unistd.h +++ b/arch/nds32/include/uapi/asm/unistd.h @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2005-2017 Andes Technology Corporation +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYNC_FILE_RANGE2 /* Use the standard ABI for syscalls */ diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h index b6bdae04bc84..d9948d88790b 100644 --- a/arch/nios2/include/uapi/asm/unistd.h +++ b/arch/nios2/include/uapi/asm/unistd.h @@ -19,6 +19,7 @@ #define sys_mmap2 sys_mmap_pgoff #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 /* 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 11c5a58ab333..ec37df18d8ed 100644 --- a/arch/openrisc/include/uapi/asm/unistd.h +++ b/arch/openrisc/include/uapi/asm/unistd.h @@ -20,6 +20,7 @@ #define sys_mmap2 sys_mmap_pgoff #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_CLONE diff --git a/arch/unicore32/include/uapi/asm/unistd.h b/arch/unicore32/include/uapi/asm/unistd.h index 65856eaab163..1e8fe5941b8a 100644 --- a/arch/unicore32/include/uapi/asm/unistd.h +++ b/arch/unicore32/include/uapi/asm/unistd.h @@ -15,4 +15,5 @@ /* Use the standard ABI for syscalls. */ #include +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_CLONE diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index cdf904265caf..ea74eca8463f 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h @@ -8,6 +8,5 @@ * be selected by default. */ #if __BITS_PER_LONG == 32 -#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_LLSEEK #endif diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 8bcb186c6f67..ce6a26c596e8 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -242,10 +242,12 @@ __SYSCALL(__NR_tee, sys_tee) /* fs/stat.c */ #define __NR_readlinkat 78 __SYSCALL(__NR_readlinkat, sys_readlinkat) +#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64) #define __NR3264_fstatat 79 __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat) #define __NR3264_fstat 80 __SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat) +#endif /* fs/sync.c */ #define __NR_sync 81