From patchwork Fri Jan 18 16:18:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 156019 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3445791jaa; Fri, 18 Jan 2019 08:26:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN4lRX1D3NMPx9oCPK506gWxKco3YpnDLOv0SppEcDbFD7/qXvaoaKruAjpEN0mZxijQBH0h X-Received: by 2002:a17:902:b90b:: with SMTP id bf11mr19595655plb.284.1547828765921; Fri, 18 Jan 2019 08:26:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547828765; cv=none; d=google.com; s=arc-20160816; b=zykrmtXuCicBNzzhMtNZIt9iQ5VFerh31cL7k5Px0OZh5BOiOJDoQs1EQ71geZuXSe fyBwFxMlfPS+FMQ8IyeLCcJmPny47b1ZAH7BwHOIWqlNDMjPDvdylQ2ZFp0HxSvnxIfw /tEeryavEOSAquFQ6IpRAxaoy7AajLRPQrznTAxobL+WwI2Lpo6OLbX2M2CHtXzgrK/2 Q6KCNdyKRYhpr/o8VyEd0pHQKKLdYtum7pomLzRmFB2Ukig5Aj1kGH+4w21w6XbRc9IC XgghZIjItJgSXWLVyI9+1gyGCKDPxnuzbNY/rAd7ZLgdjmosXfIYcsIlQmS2DSrGowuu f/BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=4y5kZycWMnI96LfRr/kNSJzvHK1Twqb+2Btye+IgFn4=; b=Dfh3Rop0I/Fpc/i+C8TWcCA2w9qeYhbG7fOMCC9FKqxEHbKE239OnKmt2YJ4D76cO7 GK1Mbox0t+OKMRoWYm9LcH/20JIJDUAiA6qfaj0B0NKo7Rj6okc92QCuZKxWSX7E+L2u j4xxhLulVZMGeY5Nl6FK7eNXMfPjebIhjZ90SBAP8n1bcWCeWxwxSrFz1+RYEGwt+F/l WMV+sG5QRHtZuPNf8oJ1r52JI7FXMJg/xG5+1kWCtrouS82lJuUdDA+sGgR+IfMRVUs3 A6mLSKvgS3EZjqux6I6XQNP1Rwh14azhqPjGovY1XRtl5T31NrpXfXdqLP5TISvp5y9I E4bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si4172061pgd.437.2019.01.18.08.26.05; Fri, 18 Jan 2019 08:26:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728770AbfARQ0E (ORCPT + 13 others); Fri, 18 Jan 2019 11:26:04 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:34459 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728759AbfARQ0A (ORCPT ); Fri, 18 Jan 2019 11:26:00 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1MJm8N-1gUmN93A53-00K81C; Fri, 18 Jan 2019 17:19:46 +0100 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@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 Subject: [PATCH v2 23/29] timex: change syscalls to use struct __kernel_timex Date: Fri, 18 Jan 2019 17:18:29 +0100 Message-Id: <20190118161835.2259170-24-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190118161835.2259170-1-arnd@arndb.de> References: <20190118161835.2259170-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:kVG9L0004kjVGZ3jTNXRJe2zDldO8i8hhwk/XZl6p/GXzXXvSu2 S5s+hnfGO6V8L06OXZk9Nmq1uc5XK0SX/tvCGfMVZwqYFwiNbnQCEsDmqBr0jqt+TgbwpgG rE1jCFnNroPTGvKPMDwi6YeE/oC7sqo/dZ97spnSvZMQuFdzPWZsc1U7WyjH13VgDKbUZqy Al7mfxahnL861tlGnkoFg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:GdtX94h4lho=:D72s1WJjk91cfsUv/xJSqk yzlJcqUOV0iT14rOcK/hs9wT1klyjDNQTUkHZpOc88O3AF/voluPHRS4rQ+QgeMruMrPrMGyY sAOjOsrQ1j+eg1PqxQ8lYmIjGjEHhUjaJQdxrUHr7T9ujCGTiHC68Ee88iNIrqzAv8MoZx+Lo /rJ124C6Bz8SG88nu7FouNfocgaJ3Jq9o74/5Tz9mpIVzORSZLNB60Wox966FvxADKx1i5dUF 2Kgm1xJUJ5p4Zerg0lijTxObrW/DJH/XIvcSeSc+o8P6NQOi/U6VaC5H0VlBukKAn9INqr4th dZ77teZe8xj1dM3o4NXA5KGQ7q2PGCEkRUvhIR+XYEWbklVCHlFGL1PN7ghP+g+R2Ep3tc4gM JOc2LvGsidceO6hVIM3WurIQXhNj8xYs4AVI/IiN2Y4UhFS1aFIvMQflPtHS2PzcZ7M12YGFX BTVZq4feGk7odojU0biV2c3YxZ+gOBpUajQ6PmScmmBAVUqSUyrNAuUbNEehuxSbgeTSX6z1V Vsjkii2fGyz4HPp6xswrIWzQdA1esCwzoqCOJZjItDgSa6z7TRtu7mc5R/ngtD1VZwgcRRSHH IxW5flI9YidANdrFLlZ+DicbDV17BjJ4uj5++7QKTRjVivKB5bUazZOfdxTDL97j10Q71uiam mbyJmAXxxLD46k3jDXn8vRyhstR7k0CTVbIC/1VrCDV2a1UY5t1SCmJVUygvCU/QG0u0GvjK+ 6q6ELhMwdPbWhoh0P8PUJ4cEasNYJS7FO5SRFg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.20.0 diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index baa4b70b02d3..09330d5bda0c 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)