From patchwork Wed Apr 25 16:03:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134351 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1050635lji; Wed, 25 Apr 2018 09:05:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx48hJvZYe9W8DSkZwHijlRO2YfrEAYjj2XdXI8m3WWtmFtQnvTsKPAaniwrE/gmNGO6VFRZR X-Received: by 10.99.182.66 with SMTP id v2mr22669003pgt.158.1524672303017; Wed, 25 Apr 2018 09:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524672303; cv=none; d=google.com; s=arc-20160816; b=bJw6+qVK/2ySah/kIJUrxlKja4tkpcQxYIzOScbI/3zKDBWpgXe2OsDgQwC/+L5JV4 rZvhw58lxMJ98GhM0o2JafyhySkXnB/cLadfzEnGHm0Bz0ld3mnTXT6chEhrVO+toQai pV0C5HzPFYyNn/IVDH3py5qoSq8PlE88lnjUG1RI5MM3uiu1kYz7o5K2SmIGi6Jf9HI7 bdafYmDMBQQztYH6g3pD0jGSn8/KQus/UdMx6fj4pt/TBRHdTNUrcW0Ssc2n3KgeTPnX KmrtqJbRAsn1bhDzg7ltHdRPZoBl1W4YjxoQrUpTUKyLdsW/FPliGiZn3kFVz5UP7G8k TF1g== 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=zMIC4FMpv4a6xmhQ5eufQ73u4pGz5FnRZCc8yzRcON0=; b=XEycT4keAJVPKQIfNKage8n+Ph5WaA6krN5xnZnbKbHdErYQA5S24lC+bgRr8EHJi6 zXBvsOGdkieomz7emupHR4aL1evYA2MgEbBp+/tntgfnueZOhXKF/Hb15C0tv+BNtAx4 1dZHemhebSi3EHlRxaWpWRliIBRPBdDtkpo+aIO+t8l3dhzYzJA7PNHEnW7IOMekhhQO GXmGl9QYVIM2ajKtGaS6r+/YSxJN8HHjTPlPBRY4TOzlw1SZk0CDud2k2BsS86Qze586 0mnMh9DCGOnzTuUTQKdY+V0y+Yr6qqN6nr0Cvjm3cVPry8mCT7eNedRs1+HGAaCiPdSa 8YAg== 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 g14-v6si10617873plj.146.2018.04.25.09.05.02; Wed, 25 Apr 2018 09:05:03 -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 S932140AbeDYQEn (ORCPT + 9 others); Wed, 25 Apr 2018 12:04:43 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:40331 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755477AbeDYQEg (ORCPT ); Wed, 25 Apr 2018 12:04:36 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LsQ2q-1eDsQO46vY-011zXI; Wed, 25 Apr 2018 18:03:41 +0200 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 17/17] y2038: signal: Add compat_sys_rt_sigtimedwait_time64 Date: Wed, 25 Apr 2018 18:03:11 +0200 Message-Id: <20180425160311.2718314-18-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425160311.2718314-1-arnd@arndb.de> References: <20180425160311.2718314-1-arnd@arndb.de> X-Provags-ID: V03:K1:O0tl35BX+FVRGiY7DYb8Pwh7dwKgNq2jlymsKjQ7HmDg4+G3hmU UnEhnvY0qus6+HVvQPkhVOb9huQ4jzCuAk0/sOjgGGTKiczmKZwpMQJZXM37sSdcW60wRRY WPFRkWF+Yci9KOyTVo0souBilbJdSGecvBCU7TyWKz0u6TApA+OoS5w+XnGQMnWdolbXyim 1yPBMlf2oKXo5v5eYG96w== X-UI-Out-Filterresults: notjunk:1; V01:K0:WbVlpHaoNGg=:ZwReD+umxITXrp3SV90uTG 2wOE5mvsGkezl+JcfqILpWaKumCzXblvtd7NDNTzrFdob3t77cdrscxh6DwmMGYr2kLF174Mr 01HBaMIzLOQMmNlT+4b5BLC4I44vxo5KrPsKRJ/1hPN/7Ea7AAPM4Qr5oBtcpZCEdZvJfmWer CeX5h8Tpy2oFSPwvI3cSEaI0+nv9mo6ufoD/ER0fCumBGHFSpLtdOWL3BJjkTD5hpM3ExJnoO DH6XyF83pwvE62uziiZlk6T1f2vPrXcja7LbbEJvz77JnMZNN4lypZh2Lf0rWsArVvrIaB3N0 lArOTd4zTPyQdOwyK/BKlHvbn393DhW4zVNzLHPpP0nfwDKtlioGCtMJMKCGnxFZRFxg3iFTI 0aOtQbwy2yrgm6F9Fc5KFLHRGEe71hn2RR6hf6toFPO/JCUtVVKWkfZ9tVX0WrZ9YtBFMFCCX Zg9RjJTQjlhYxi4U7bu82V6QRhnqO612xLNr8DrBvymyLPhuyvYgGj1c/U68rBe4m8htYhEiR lK2s8BJm7jX+CMt9XZj9+ONGq4NRWSuw5SPZQUM2DtHWeltvDuMFJvoNhiRFzOd5/e6bogUHF vm43722rWpikKGmvx4Z/Sih/H8fwwxLiBa1eYHPflqATwcIOhe4UUQIWKm05SAbtQs4l9MP9A wTtxp1MMYnAJwY9MLwuzzw0eDGDw6lVd7C7G1ALcCq2XbmwtDIUO8/TpRd7gdo+2BbIk= 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 72609c6835fd..1927fcfa7077 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -3249,6 +3249,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