History

kernel: add a kernel_wait helper

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.

Christoph Hellwig committed 6 years ago

Commit 8043fc11 parent f48ff833 files · +21 −25Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/sched/task.h+1−0
@@ -88,6 +88,7 @@ struct task_struct *fork_idle(int); · 87 unmodified lines
88struct mm_struct *copy_init_mm(void);88struct mm_struct *copy_init_mm(void);
89extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);89extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
90extern long kernel_wait4(pid_t, int __user *, int, struct rusage *);90extern long kernel_wait4(pid_t, int __user *, int, struct rusage *);
91int kernel_wait(pid_t pid, int *stat);
91 92
92extern void free_task(struct task_struct *tsk);93extern void free_task(struct task_struct *tsk);
93 94