Commit 49c39f84 authored by Arnd Bergmann's avatar Arnd Bergmann

y2038: signal: Change rt_sigtimedwait to use __kernel_timespec

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: default avatarArnd Bergmann <arnd@arndb.de>
parent c2e6c856
...@@ -635,7 +635,7 @@ asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set, ...@@ -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_sigpending(sigset_t __user *set, size_t sigsetsize);
asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese, asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese,
siginfo_t __user *uinfo, siginfo_t __user *uinfo,
const struct timespec __user *uts, const struct __kernel_timespec __user *uts,
size_t sigsetsize); size_t sigsetsize);
asmlinkage long sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo); asmlinkage long sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo);
......
...@@ -3082,7 +3082,7 @@ int copy_siginfo_from_user32(struct siginfo *to, ...@@ -3082,7 +3082,7 @@ int copy_siginfo_from_user32(struct siginfo *to,
* @ts: upper bound on process time suspension * @ts: upper bound on process time suspension
*/ */
static int do_sigtimedwait(const sigset_t *which, siginfo_t *info, 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; ktime_t *to = NULL, timeout = KTIME_MAX;
struct task_struct *tsk = current; struct task_struct *tsk = current;
...@@ -3090,9 +3090,9 @@ static int do_sigtimedwait(const sigset_t *which, siginfo_t *info, ...@@ -3090,9 +3090,9 @@ static int do_sigtimedwait(const sigset_t *which, siginfo_t *info,
int sig, ret = 0; int sig, ret = 0;
if (ts) { if (ts) {
if (!timespec_valid(ts)) if (!timespec64_valid(ts))
return -EINVAL; return -EINVAL;
timeout = timespec_to_ktime(*ts); timeout = timespec64_to_ktime(*ts);
to = &timeout; to = &timeout;
} }
...@@ -3140,11 +3140,12 @@ static int do_sigtimedwait(const sigset_t *which, siginfo_t *info, ...@@ -3140,11 +3140,12 @@ static int do_sigtimedwait(const sigset_t *which, siginfo_t *info,
* @sigsetsize: size of sigset_t type * @sigsetsize: size of sigset_t type
*/ */
SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, 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) size_t, sigsetsize)
{ {
sigset_t these; sigset_t these;
struct timespec ts; struct timespec64 ts;
siginfo_t info; siginfo_t info;
int ret; int ret;
...@@ -3156,7 +3157,7 @@ SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, ...@@ -3156,7 +3157,7 @@ SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese,
return -EFAULT; return -EFAULT;
if (uts) { if (uts) {
if (copy_from_user(&ts, uts, sizeof(ts))) if (get_timespec64(&ts, uts))
return -EFAULT; return -EFAULT;
} }
...@@ -3176,7 +3177,7 @@ COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, compat_sigset_t __user *, uthese, ...@@ -3176,7 +3177,7 @@ COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, compat_sigset_t __user *, uthese,
struct old_timespec32 __user *, uts, compat_size_t, sigsetsize) struct old_timespec32 __user *, uts, compat_size_t, sigsetsize)
{ {
sigset_t s; sigset_t s;
struct timespec t; struct timespec64 t;
siginfo_t info; siginfo_t info;
long ret; long ret;
...@@ -3187,7 +3188,7 @@ COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, compat_sigset_t __user *, uthese, ...@@ -3187,7 +3188,7 @@ COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, compat_sigset_t __user *, uthese,
return -EFAULT; return -EFAULT;
if (uts) { if (uts) {
if (compat_get_timespec(&t, uts)) if (get_old_timespec32(&t, uts))
return -EFAULT; return -EFAULT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment