diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2018-07-22 10:07:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-22 14:51:30 -0400 |
commit | f88a333b44318643282b8acc92af90deda441f5e (patch) | |
tree | 69a92ace171ff8207224a1808686fbf24ccb84ab | |
parent | 45ae4df9220701071ffec057d4b0071943022ab3 (diff) |
alpha: fix osf_wait4() breakage
kernel_wait4() expects a userland address for status - it's only
rusage that goes as a kernel one (and needs a copyout afterwards)
[ Also, fix the prototype of kernel_wait4() to have that __user
annotation - Linus ]
Fixes: 92ebce5ac55d ("osf_wait4: switch to kernel_wait4()")
Cc: stable@kernel.org # v4.13+
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/alpha/kernel/osf_sys.c | 5 | ||||
-rw-r--r-- | include/linux/sched/task.h | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 6e921754c8fc..c210a25dd6da 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -1180,13 +1180,10 @@ SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru) | |||
1180 | SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options, | 1180 | SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options, |
1181 | struct rusage32 __user *, ur) | 1181 | struct rusage32 __user *, ur) |
1182 | { | 1182 | { |
1183 | unsigned int status = 0; | ||
1184 | struct rusage r; | 1183 | struct rusage r; |
1185 | long err = kernel_wait4(pid, &status, options, &r); | 1184 | long err = kernel_wait4(pid, ustatus, options, &r); |
1186 | if (err <= 0) | 1185 | if (err <= 0) |
1187 | return err; | 1186 | return err; |
1188 | if (put_user(status, ustatus)) | ||
1189 | return -EFAULT; | ||
1190 | if (!ur) | 1187 | if (!ur) |
1191 | return err; | 1188 | return err; |
1192 | if (put_tv_to_tv32(&ur->ru_utime, &r.ru_utime)) | 1189 | if (put_tv_to_tv32(&ur->ru_utime, &r.ru_utime)) |
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h index 5be31eb7b266..108ede99e533 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h | |||
@@ -75,7 +75,7 @@ extern long _do_fork(unsigned long, unsigned long, unsigned long, int __user *, | |||
75 | extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); | 75 | extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); |
76 | struct task_struct *fork_idle(int); | 76 | struct task_struct *fork_idle(int); |
77 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | 77 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
78 | extern long kernel_wait4(pid_t, int *, int, struct rusage *); | 78 | extern long kernel_wait4(pid_t, int __user *, int, struct rusage *); |
79 | 79 | ||
80 | extern void free_task(struct task_struct *tsk); | 80 | extern void free_task(struct task_struct *tsk); |
81 | 81 | ||