public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
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 <arnd@arndb.de>
Subject: [PATCH v2 17/17] y2038: signal: Add compat_sys_rt_sigtimedwait_time64
Date: Mon, 16 Jul 2018 16:12:00 -0000	[thread overview]
Message-ID: <20180716161103.16239-18-arnd@arndb.de> (raw)
In-Reply-To: <20180716161103.16239-1-arnd@arndb.de>

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 <arnd@arndb.de>
---
 kernel/signal.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

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
-- 
2.9.0

  reply	other threads:[~2018-07-16 16:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 16:12 [PATCH v2 00/17] y2038: system calls, part 3 Arnd Bergmann
2018-07-16 16:12 ` Arnd Bergmann [this message]
2018-07-16 16:12 ` [PATCH v2 13/17] y2038: socket: Convert recvmmsg to __kernel_timespec Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 09/17] y2038: futex: Move compat implementation into futex.c Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 10/17] y2038: futex: Add support for __kernel_timespec Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 15/17] y2038: signal: Change rt_sigtimedwait to use __kernel_timespec Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 16/17] y2038: Make compat_sys_rt_sigtimedwait usable on 32-bit Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 07/17] y2038: Compile utimes()/futimesat() conditionally Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 12/17] y2038: aio: Prepare sys_io_{p,}getevents for __kernel_timespec Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 02/17] y2038: Remove newstat family from default syscall set Arnd Bergmann
2018-07-17 12:50   ` Christoph Hellwig
2018-07-17 14:18     ` Arnd Bergmann
2018-07-18 20:15       ` Joseph Myers
2018-07-19  8:53         ` Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 08/17] y2038: utimes: Rework #ifdef guards for compat syscalls Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 01/17] y2038: compat: Move common compat types to asm-generic/compat.h Arnd Bergmann
2018-07-17 12:49   ` Christoph Hellwig
2018-07-16 16:12 ` [PATCH v2 11/17] y2038: Prepare sched_rr_get_interval for __kernel_timespec Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 14/17] y2038: socket: Add compat_sys_recvmmsg_time64 Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 06/17] y2038: Change sys_utimensat() to use __kernel_timespec Arnd Bergmann
2018-07-17 12:52   ` Christoph Hellwig
2018-07-17 14:27     ` Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 03/17] y2038: Remove stat64 family from default syscall set Arnd Bergmann
2018-07-16 16:12 ` [PATCH v2 05/17] asm-generic: Remove empty asm/unistd.h Arnd Bergmann
2018-07-17 12:51   ` Christoph Hellwig
2018-07-16 16:12 ` [PATCH v2 04/17] asm-generic: Remove unneeded __ARCH_WANT_SYS_LLSEEK macro Arnd Bergmann
2018-07-17 12:51   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180716161103.16239-18-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=albert.aribaud@3adev.fr \
    --cc=dvhart@infradead.org \
    --cc=ebiederm@xmission.com \
    --cc=hch@infradead.org \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=y2038@lists.linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).