Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Al Viro and committed by
Linus Torvalds
f88a333b 45ae4df9

+2 -5
+1 -4
arch/alpha/kernel/osf_sys.c
··· 1180 1180 SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options, 1181 1181 struct rusage32 __user *, ur) 1182 1182 { 1183 - unsigned int status = 0; 1184 1183 struct rusage r; 1185 - long err = kernel_wait4(pid, &status, options, &r); 1184 + long err = kernel_wait4(pid, ustatus, options, &r); 1186 1185 if (err <= 0) 1187 1186 return err; 1188 - if (put_user(status, ustatus)) 1189 - return -EFAULT; 1190 1187 if (!ur) 1191 1188 return err; 1192 1189 if (put_tv_to_tv32(&ur->ru_utime, &r.ru_utime))
+1 -1
include/linux/sched/task.h
··· 75 75 extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); 76 76 struct task_struct *fork_idle(int); 77 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 80 extern void free_task(struct task_struct *tsk); 81 81