From patchwork Wed Apr 25 16:03:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 904484 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-91852-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="U0t/RIt+"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40WQ6w2P1Lz9s0t for ; Thu, 26 Apr 2018 02:06:32 +1000 (AEST) 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=kOgtwAAviXUvWtiY7UI0G/mNiZKT62q bm8gjdJc+Af22ZpLkgE7C2y9ANyxHHfxV7pDdZa3j772hBIqRwfnJtvaFoiz/eVE C2JXH/+I+9S/BSsOkvNkETXs/wgJ88ahQ2PiPIboEyiRxYKgH7QYupGoxC79eTAM iA69prfWjIhs= 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=c/CpUH2RdWIDSM+o9G9Eeo+MiM4=; b=U0t/R It+02PD9QX0k6U8oAmdN7afdBLBSq0HuDvroPaP/LcA/m27lB9x2ck9DR4vtRfZl QI1JCupW0jxmNcUrEmpP/jqeYSgVjJbNgjFnAH9EK73klowg883WPspa3494UduX Y9X713EuUvHvUtEoM7HO3khhTP6A0KLapeikZE= Received: (qmail 63575 invoked by alias); 25 Apr 2018 16:05:22 -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 63412 invoked by uid 89); 25 Apr 2018 16:05:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 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=ts 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 15/17] y2038: signal: Change rt_sigtimedwait to use __kernel_timespec Date: Wed, 25 Apr 2018 18:03:09 +0200 Message-Id: <20180425160311.2718314-16-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:65jbx0DJbIk=:KWKqWzqjhcBy1utrBqYdqt mgvLBj5/KSyO/c38AMRkPzgZsb5LFL5gdXbUNrna6LXJ+ROGyGzo4/FcesmTY58V8u2IRDcv8 b/67hERSiO3Rn6qjF2BovO6tydFk3i1muhZeWVwaNUL6R7GGZtTnEOl/qTCD5t3Hjq4LNQKiv 9nzInNlEV9tJ0ktysDRznjvGMDU4TOp9/B2MqGbhscjNNH2AlxoF5enjBfDZCI0CqXI5j5D4n 9D68PL/jwbQ0J8trtz+Q9z/9tOtmuqXymPvpRK9mtmXQWk37tpyrWpyQJ6syXI4ew7E2ifEhJ KvWTGFErQ2Za94+Aesp+qr5ExvOQVP/3t/DsmCXM8eSpPMD2W8eCB86XV6nA0g2jd50bhupOz sMSp+PkQkgMsE7pyS/yiUOor0pY7Mw4APyj0KUsqzQ7ojiX7hERF6JN4dsYkE/fdwHU+EHduj M4eHPuEa4uz3kItFi86W8rLDdqCeXrsG+US/8wlia40fTazLmbRTPCP2+EFqHvsnzz0ZJtoE/ fA0HuNwy5RMhkaXF6CvHdqb99xCpoNLwC8AchEcFYLjQtmACWeIwAmuKYvHAX1mAS7fi4N2+E OrCeMr86o2zqp1wUa7yxw3t5QSijelOva2dCkul2AVi6BjxSYBX9JsfZ301ArfdJtz6oIsoF+ p2JpfShxx+IpaU/QewNrp/rv2Q2Fg68qhqZ6RpV9j8mkXUzvDN8mDbXfkWJJvXNepk2E= This changes sys_rt_sigtimedwait() to use get_timespec64(), changing the timeout type to __kernel_timespec, which will be changed to use a 64-bit time_t in the future. Since the do_sigtimedwait() core function changes, we also have to modify the compat version of this system call in the same way. Signed-off-by: Arnd Bergmann --- include/linux/syscalls.h | 2 +- kernel/signal.c | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index eaa32317f573..a756ab42894f 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -622,7 +622,7 @@ asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set, asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize); asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese, siginfo_t __user *uinfo, - const struct timespec __user *uts, + const struct __kernel_timespec __user *uts, size_t sigsetsize); asmlinkage long sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo); diff --git a/kernel/signal.c b/kernel/signal.c index d4ccea599692..d8d68a9556ae 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -3113,7 +3113,7 @@ int copy_siginfo_from_user32(struct siginfo *to, * @ts: upper bound on process time suspension */ static int do_sigtimedwait(const sigset_t *which, siginfo_t *info, - const struct timespec *ts) + const struct timespec64 *ts) { ktime_t *to = NULL, timeout = KTIME_MAX; struct task_struct *tsk = current; @@ -3121,9 +3121,9 @@ static int do_sigtimedwait(const sigset_t *which, siginfo_t *info, int sig, ret = 0; if (ts) { - if (!timespec_valid(ts)) + if (!timespec64_valid(ts)) return -EINVAL; - timeout = timespec_to_ktime(*ts); + timeout = timespec64_to_ktime(*ts); to = &timeout; } @@ -3171,11 +3171,12 @@ static int do_sigtimedwait(const sigset_t *which, siginfo_t *info, * @sigsetsize: size of sigset_t type */ SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, - siginfo_t __user *, uinfo, const struct timespec __user *, uts, + siginfo_t __user *, uinfo, + const struct __kernel_timespec __user *, uts, size_t, sigsetsize) { sigset_t these; - struct timespec ts; + struct timespec64 ts; siginfo_t info; int ret; @@ -3187,7 +3188,7 @@ SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, return -EFAULT; if (uts) { - if (copy_from_user(&ts, uts, sizeof(ts))) + if (get_timespec64(&ts, uts)) return -EFAULT; } @@ -3207,7 +3208,7 @@ COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, compat_sigset_t __user *, uthese, struct compat_timespec __user *, uts, compat_size_t, sigsetsize) { sigset_t s; - struct timespec t; + struct timespec64 t; siginfo_t info; long ret; @@ -3218,7 +3219,7 @@ COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, compat_sigset_t __user *, uthese, return -EFAULT; if (uts) { - if (compat_get_timespec(&t, uts)) + if (compat_get_timespec64(&t, uts)) return -EFAULT; }