Add a helper that waits for a pid and stores the status in the passed in kernel pointer. Use it to fix the usage of kernel_wait4 in call_usermodehelper_exec_sync that only happens to work due to the implicit set_fs(KERNEL_DS) for kernel threads.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -88,6 +88,7 @@ struct task_struct *fork_idle(int); · 87 unmodified lines | |||
| 88 | struct mm_struct *copy_init_mm(void); | 88 | struct mm_struct *copy_init_mm(void); |
| 89 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | 89 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
| 90 | extern long kernel_wait4(pid_t, int __user *, int, struct rusage *); | 90 | extern long kernel_wait4(pid_t, int __user *, int, struct rusage *); |
| 91 | int kernel_wait(pid_t pid, int *stat); | ||
| 91 | 92 | ||
| 92 | extern void free_task(struct task_struct *tsk); | 93 | extern void free_task(struct task_struct *tsk); |
| 93 | 94 | ||