From patchwork Thu Jan 10 17:22:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10756391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6DA7A13BF for ; Thu, 10 Jan 2019 17:28:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56EBD29784 for ; Thu, 10 Jan 2019 17:28:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4952A29C1E; Thu, 10 Jan 2019 17:28:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2EC629784 for ; Thu, 10 Jan 2019 17:28:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729981AbfAJR2n (ORCPT ); Thu, 10 Jan 2019 12:28:43 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:55459 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729519AbfAJR2m (ORCPT ); Thu, 10 Jan 2019 12:28:42 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1MXp1O-1gn0kD2DHw-00Y6aZ; Thu, 10 Jan 2019 18:22:29 +0100 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , mattst88@gmail.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, tony.luck@intel.com, fenghua.yu@intel.com, geert@linux-m68k.org, monstr@monstr.eu, paul.burton@mips.com, deller@gmx.de, benh@kernel.crashing.org, mpe@ellerman.id.au, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, dalias@libc.org, davem@davemloft.net, luto@kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, jcmvbkbc@gmail.com, akpm@linux-foundation.org, deepa.kernel@gmail.com, ebiederm@xmission.com, firoz.khan@linaro.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH 06/11] timex: change syscalls to use struct __kernel_timex Date: Thu, 10 Jan 2019 18:22:11 +0100 Message-Id: <20190110172216.313063-7-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190110172216.313063-1-arnd@arndb.de> References: <20190110172216.313063-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:4lo+P0Jssf80yBpLJNqYJgkfsZFwI33q3gIWB3cTNQ6r/2Wo8AP K0fcuczrITU2zqExzuVqdUFRe951ZBXZdhvuNYueI9HRB/wAuM//Jxw32Zhzt7rs+9cWSNa oelu2KFU17/9u1/baRsXVk4dlNgBuOSrd/sBG/x9LFm4MsBvDE0xR2Nv7Z/ch6WGgE4G9sa rgGYWLhXf4N1GHKl2M65w== X-UI-Out-Filterresults: notjunk:1;V03:K0:Ex1jn0af5BU=:bdsVGTxlAhmtjwRIgR6eTI A6S5rnxwNHQOTJ5wkUU8iQj15DJ8B4PGE5oaXe2FiwQd1vUxLtu4LolchmDA2f1eXTej9jyu6 x9UcI0IGhLKozYOViHtZZYanwoHR6sZ7k1NSDOwP6srOhNDZiJII2LdQvL6Cvxf9ulGif9liF WK0zzsiHfFCIZowb20Lu6CgLh8apZBrhB3+jR/iohmjOjAnyGBmvzP2SMk+0tQziIIBMEbeou UCZNwl5e87zMy+AInX9jyvLnjNIqvAB8VQhmKrueWUiWOCm0zQ3ZDYjEvYPwjNkSdqZoAyxtg iBEhmi2A4DTtZLTGBU0sLZYx3GekSmri2P1ly3jZHAJSVuma20FgAR5vxIW739U/DPQp5Wizt T/ofzDRrit15IQybfvoIqZaPuOVWQlYW94MMLa7hKcDt7ACA7q5nXyPdfDl9hAVQzyYIG1gqc QZbQPEElC+uYbRh2GjCHhlmL0Bxv2EH9pLRPNDEnRZKScKzhhXmIfsRE9BiOo47k1szyt0sJo 8GB80a+OMHVA9umcqSAutnVoNJjn79SVERawkT+g+agsDkSH6q/EauYLfQxeDjWHW/rgZ6+KF B2nvfG/KIkVGZdAfyFh7x/Q1V9lhOgfGbiwxLaMLjKn17be5kAu/Ns+N4Q5OIUYeW3V6dpiKg ng2TAuGMOKmBfVJLshy1Ld5uwcy0rCu24SLYmPTihXMdum5WLSbioTUZBTr42yrettAcxMDS3 5wnuXitzJJuDXGn/RQ6if954eiQU6enck0+NWw== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Deepa Dinamani struct timex is not y2038 safe. Switch all the syscall apis to use y2038 safe __kernel_timex. Note that sys_adjtimex() does not have a y2038 safe solution. C libraries can implement it by calling clock_adjtime(CLOCK_REALTIME, ...). Signed-off-by: Deepa Dinamani Signed-off-by: Arnd Bergmann --- include/linux/syscalls.h | 6 +++--- kernel/time/posix-timers.c | 2 +- kernel/time/time.c | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 8e86d9623d4e..394e8db7e57e 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -54,7 +54,7 @@ struct __sysctl_args; struct sysinfo; struct timespec; struct timeval; -struct timex; +struct __kernel_timex; struct timezone; struct tms; struct utimbuf; @@ -695,7 +695,7 @@ asmlinkage long sys_gettimeofday(struct timeval __user *tv, struct timezone __user *tz); asmlinkage long sys_settimeofday(struct timeval __user *tv, struct timezone __user *tz); -asmlinkage long sys_adjtimex(struct timex __user *txc_p); +asmlinkage long sys_adjtimex(struct __kernel_timex __user *txc_p); /* kernel/timer.c */ asmlinkage long sys_getpid(void); @@ -870,7 +870,7 @@ asmlinkage long sys_open_by_handle_at(int mountdirfd, struct file_handle __user *handle, int flags); asmlinkage long sys_clock_adjtime(clockid_t which_clock, - struct timex __user *tx); + struct __kernel_timex __user *tx); asmlinkage long sys_syncfs(int fd); asmlinkage long sys_setns(int fd, int nstype); asmlinkage long sys_sendmmsg(int fd, struct mmsghdr __user *msg, diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index 2d84b3db1ade..de79f85ae14f 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -1060,7 +1060,7 @@ int do_clock_adjtime(const clockid_t which_clock, struct __kernel_timex * ktx) } SYSCALL_DEFINE2(clock_adjtime, const clockid_t, which_clock, - struct timex __user *, utx) + struct __kernel_timex __user *, utx) { struct __kernel_timex ktx; int err; diff --git a/kernel/time/time.c b/kernel/time/time.c index d179d33f639a..78b5c8f1495a 100644 --- a/kernel/time/time.c +++ b/kernel/time/time.c @@ -263,7 +263,8 @@ COMPAT_SYSCALL_DEFINE2(settimeofday, struct old_timeval32 __user *, tv, } #endif -SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p) +#if !defined(CONFIG_64BIT_TIME) || defined(CONFIG_64BIT) +SYSCALL_DEFINE1(adjtimex, struct __kernel_timex __user *, txc_p) { struct __kernel_timex txc; /* Local copy of parameter */ int ret; @@ -277,6 +278,7 @@ SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p) ret = do_adjtimex(&txc); return copy_to_user(txc_p, &txc, sizeof(struct __kernel_timex)) ? -EFAULT : ret; } +#endif #ifdef CONFIG_COMPAT_32BIT_TIME int get_old_timex32(struct __kernel_timex *txc, const struct old_timex32 __user *utp)