kernel: add a kernel_wait helper
authorChristoph Hellwig <hch@lst.de>
Wed, 12 Aug 2020 01:34:10 +0000 (18:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Aug 2020 17:57:59 +0000 (10:57 -0700)
commit8043fc147a97ec2eefc582487f344f2cbe86d12e
tree05be60738ff9974830290aa6a4459336ecdd45d9
parentf48ff83e9c1a8fc2e8bfedb4855933eb1ed159b2
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.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Link: http://lkml.kernel.org/r/20200721130449.5008-1-hch@lst.de
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/sched/task.h
kernel/exit.c
kernel/umh.c