From patchwork Mon Jul 16 16:11:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 142050 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2604404ljj; Mon, 16 Jul 2018 09:12:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcsHBriOT03pPmwowbZmKkjNhli1jm30G3TzgpyTu4N9WxKao1ze5NDDNQ+HbMmo6fnIQtk X-Received: by 2002:a17:902:7688:: with SMTP id m8-v6mr17134055pll.338.1531757541720; Mon, 16 Jul 2018 09:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531757541; cv=none; d=google.com; s=arc-20160816; b=UWNNy9kHksQKNCUHh2+iSl8hTwGE6Ri2vB4hhd9hrtnr+7oCC2NGJBc3JtzffY3ksv bCsFzv0TQIMNnq9D35UCR42A82yTmpPf4IafmygCcylwzphijATTHRKexpzrAmtPDlYf EtvJdEVZJr/lC8Db+46oYIrkXDCHOeAjE0k3rRKIq3KDPWYHitT/0gZnNaNMhcbgmb97 ohyplK5UDkVHdYfDwQmR2yRu8ugRUzwwvkyDHuOBdLNPk7CjLTHpHbThXJ/xVKqxvVBY qWWqgflJ+lMZGyGUa6QKUZVIlWi0jiuuyoM00ov9PgCySvax9Tn2Xf5tPbajewO12rrM 5uXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=6a4ZCRkp6qRpNc1SCN9u0GM6knrRsqgsu368x2Ch7qo=; b=AYh6KbTbqZbSwTqgXr67nsj5SY+AWld13F7iRgBanck7KGAeAuxgu/vfCZ+owrc15x iD4H1bGT6GkrX9F1SaKFimevbNnrdzhOytfSuzP1bclfVkIth0Um9yXHB7XFTSSosL4Q 0qW3H3UnXQjxLEn8Ndxw52iHdRMEP6Z3CPhRU8pMifg1gIMh+uw71ZAg/NfwXjf9B+L+ egOitIYhYpJl0dyMHt3EKmsgfvlvygMgpBJItozkb1oUsI5KFxkAxW6P9q5NLD0eibqK SrNESb3h4812jB7nOkloYWFbr7iVjh9tEzpddzrsV0O88kh/OBV3WxaRwjCDColdYZUI IXBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 l7-v6si30064885pgc.650.2018.07.16.09.12.21; Mon, 16 Jul 2018 09:12:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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 netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731075AbeGPQkM (ORCPT + 10 others); Mon, 16 Jul 2018 12:40:12 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:57732 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727970AbeGPQkM (ORCPT ); Mon, 16 Jul 2018 12:40:12 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.129]) with ESMTPA (Nemesis) id 0M3qBK-1fx2Nk0TgY-00raGK; Mon, 16 Jul 2018 18:11:14 +0200 From: Arnd Bergmann To: tglx@linutronix.de Cc: y2038@lists.linaro.org, hch@infradead.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, albert.aribaud@3adev.fr, netdev@vger.kernel.org, viro@zeniv.linux.org.uk, peterz@infradead.org, dvhart@infradead.org, ebiederm@xmission.com, linux@dominikbrodowski.net, Arnd Bergmann Subject: [PATCH v2 15/17] y2038: signal: Change rt_sigtimedwait to use __kernel_timespec Date: Mon, 16 Jul 2018 18:11:01 +0200 Message-Id: <20180716161103.16239-16-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180716161103.16239-1-arnd@arndb.de> References: <20180716161103.16239-1-arnd@arndb.de> X-Provags-ID: V03:K1:MJMf8M44KxCDluKOHJYbdp1uKcxmm4nl6kLnUVTpNFl36PsezzX aMAQ9dbWp+Wt+VIPpDiGe/yXX1XvhEpxC19xDyETQaZvh51QUXZx7wUmR0fkrg3neVzxinh NXamdzjjxae/qd6bKFmfzRphJoQpspSG+p0FbUB81TPMbS3tGcFnifONhjhpBTV4PPkQZj3 PNwZM2zx4bWNZRGtV6K4Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:rJzzpnK2rHM=:k+unioP7w8ElRem10eorc5 f+GaEkQFsm+pGMaK7tP4OjfQfuiGiRrTgvUINhvERSSqz912Z65axGu5XEmswMniXgiM4WEjZ 93Qk7wDKWnFdJu/hP4NrpFWcjHgZj7Zk27qvIgSYckU77eVOtHUsjtddCPEs9xmLC9I1CR/ar FQsC4760GdcLM4yiC+nDpuQ/5kGtihxW4NwRw2KP2iJwjO2PEGaWrcFS6IaT7tOXnMOdt9+bl ef1SOxkRpyXDYJz8zP8GxcR8oouuPwEe+zhNNlKDITYza3s6/VaikrYlQ+ZcXi8DZJCMjrgoQ GRzYEQVWkt/B5ySWUe+lsGIgsNWOyo3npfDQ8BcLUrQAta0lixu3FjzhL756bhPlVhuJFBIXl jLkVHFlFvem0mt2jNAS6jeR9+wNmeXXti+P44bWqBuQt7EPZbbvrT0wuB0vXwyOvtaA6pUFw+ QE7bRFSR4b2/aQMqoVAxqoeTcI8+wAk5zYS1NwRzBR/2QAKw5Wou3VlNEzo3yhcuiMzSZgh1e JfesG6yrobHmN7Ke71cjVNDcDuTdSaRPVbS2WFhy4Rdf0Qa4z3QMoHTIpQfp9g4w3wgNrAEGH QzwY57W/h4a8NnjC3C1n9UxzGO5PvkwZ2nG8fr7gNayQ3eZZ5Rj5h8/F5c/1CWs+XGNW7fsMM 3eez4gXEhFprRRo/UGvxcBu9UwlHa97OVS6Zq1hgVM0yPRj2kxwk/P7k0iGS8iXo9zGI= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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(-) -- 2.9.0 diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 6871f6901a70..9c1da8752724 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -635,7 +635,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 786bacc60649..0418a499b9f3 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -3036,7 +3036,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; @@ -3044,9 +3044,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; } @@ -3094,11 +3094,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; @@ -3110,7 +3111,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; } @@ -3130,7 +3131,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; @@ -3141,7 +3142,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; }