From patchwork Mon Jul 16 16:11:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 142041 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2604041ljj; Mon, 16 Jul 2018 09:12:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfmepHegD/BlK8vAGN/NUL7v3+y2x5iJ/zvR6Yg7mhSRq6D2IoQiOZdRmDAw0DpkK8xyvED X-Received: by 2002:a63:62c4:: with SMTP id w187-v6mr15966959pgb.55.1531757521841; Mon, 16 Jul 2018 09:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531757521; cv=none; d=google.com; s=arc-20160816; b=jk8Z0CxJd4EnG38qDYZP0pdXS6BjD3glXv/L2oizPwxAgJKhDSlyMivOk8NdpiMVYi wjkNgO9t0L6VQnFWchUz8A6Gpinll6UJnNiarEllxemgfgYIy7ZM0dYFGh8IYgDP2mhk GqGoaOfXgSuR8rgcbA18hRLEhHwZgo3kWabQJBAR8o6Qk6NVz7yByLLumodI2J7Dbo4d xLx9aT/G3ZLC2kMwSlWt33I2+q8Kt3wS2YQapLyKNwzyX3N9fUOeBsc/mHfHEwTyozu3 TbiiwATM7RSkn3Iplh12/+vDG8NdIv9P1M4IJjzXclGU4n+TCFR36fuUW/XpexhsYgtf UxMQ== 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=uxsMAIH9gbKkv1JWpxuuiklcuEIwLTH4r2KNDbEqh0Q=; b=Olbi174mZRyKRGMEWE/etiKzUrwVLpXj0bf49HfrXwEkd1Ot0NU4TzfwGvDGUc/IDp JIb3h+xnAShkbnqGB9XYZLwz4M2IUY2t+lhIYfyHwo3TuLAVYFwfGcHJI4YCGnDmdo0H vhjJqIS4dhF9NFilcGvlCodHvs//N6NbEfHRqLCXSl21xKk7/0Snq8hxD4XT1xt6RdCZ PIFfg5Eksz0mEtB36MCx/61vi+CuwoFcmZXy/mjEGgmrErz4flfSCb9mgPAznA459RCj zYpQoScut7XfdYWbGMBv5fU7eobW8lVJrrP2RCfLBv/vm1ESZpfjh7TQtHXULrB87TpG yxnQ== 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 x18-v6si30410996pfh.84.2018.07.16.09.12.01; Mon, 16 Jul 2018 09:12:01 -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 S1730301AbeGPQkG (ORCPT + 10 others); Mon, 16 Jul 2018 12:40:06 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:37023 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727970AbeGPQkF (ORCPT ); Mon, 16 Jul 2018 12:40:05 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.129]) with ESMTPA (Nemesis) id 0MP6Q7-1fjExg0QRb-006Kev; Mon, 16 Jul 2018 18:11:15 +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 17/17] y2038: signal: Add compat_sys_rt_sigtimedwait_time64 Date: Mon, 16 Jul 2018 18:11:03 +0200 Message-Id: <20180716161103.16239-18-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:40zNK9JfrNweTaqlK0Ah2eHvE1kIbB5bvNRYnw1vbgETF2raHkI KmKSUAFOjisd5MGyfWLOiaLD0pJDYMsQuQgfR+ph6XvKOyYfn43XaOKo0m1tLlMuzpe0XG3 wsNxyv4pjBx+a4rBLSvgk7ERgfYZdSDmvZHtIQfhAalATkVykjHFtFgWk+YtSlImcVYXZbx y84Bn/J/wGwBjR6f1zrng== X-UI-Out-Filterresults: notjunk:1; V01:K0:LEVD/ozFT/E=:v4w/xApCuhVSetNoTsSlIO St5kbOxT8OZxe+8cnIe0fOuzrGpO0yZ4QDEOhdzoHIioDLH0tYu0H6TbRHityGchF+wfocQqN Mf2KIfUxt1ofsGCPBGFBd4tHOA9v3Zlyy7HF8Qg/HZP32jIHQAba/OuxZ0KRWWSFoJZz7+gKS 1RImODr5bz4IouAVKDsTKwsnL6Mu8UoS9bQvfRbqST3fNpvErWIUxFiHKdymyWVsvr9ag8wH1 zY/6PYwHXJjJ1rH3FL/wrAhdA3YaqLLIbPZQCmty9UQwsjFZ6r4Id3p/X88oJ8aRAOXNGL9+Y JjoC7vesgWlaKsBJiSXafMd5yq0Uec2W1mY5ovj0sn2TvoywG6P3COoMAM5f7XpJjOd89OS6j xA6KJRNPP17zl/XEp6B9o1rCNL15fT9W3EckG6i4jnraWLV/112Pk9wSdyongRU8gafzqNgHn u6u4WDsBMcYakXEm5Yt66gsBdYFx987rMQyMGDrd/imGpqdR/eICGMeO4xe0Pj1/ZcPvXvlxj oGb4LRHKWeir+UuIh8c5nRzfW5sh+6WD5u+eeQsonOzeOvw7yPtUgsfg0H5O++lanCbV8GlST bom2Y2Tzuz4AM+vLbXlAMBlUYr8ygssUrMXHpcsirQ3pM2MC/WNEAG+ruiTw9dm0ZTvFg+ePm 9WuUnW1egbjXh1mMrhUAO+hDQ/MsQ0d7V/vc5sUmB5Zhgv0YLmreooEgWzVpYkClPPS0= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Now that 32-bit architectures have two variants of sys_rt_sigtimedwaid() for 32-bit and 64-bit time_t, we also need to have a second compat system call entry point on the corresponding 64-bit architectures. The traditional system call keeps getting handled by compat_sys_rt_sigtimedwait(), and this adds a new compat_sys_rt_sigtimedwait_time64() that differs only in the timeout argument type. Signed-off-by: Arnd Bergmann --- kernel/signal.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) -- 2.9.0 diff --git a/kernel/signal.c b/kernel/signal.c index 8d4382d5182f..332f019dc421 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -3172,6 +3172,38 @@ COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, compat_sigset_t __user *, uthese, } #endif +#ifdef CONFIG_COMPAT +COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait_time64, compat_sigset_t __user *, uthese, + struct compat_siginfo __user *, uinfo, + struct __kernel_timespec __user *, uts, compat_size_t, sigsetsize) +{ + sigset_t s; + struct timespec64 t; + siginfo_t info; + long ret; + + if (sigsetsize != sizeof(sigset_t)) + return -EINVAL; + + if (get_compat_sigset(&s, uthese)) + return -EFAULT; + + if (uts) { + if (get_timespec64(&t, uts)) + return -EFAULT; + } + + ret = do_sigtimedwait(&s, &info, uts ? &t : NULL); + + if (ret > 0 && uinfo) { + if (copy_siginfo_to_user32(uinfo, &info)) + ret = -EFAULT; + } + + return ret; +} +#endif + /** * sys_kill - send a signal to a process * @pid: the PID of the process