Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kunit: Fix race condition in try-catch completion
KUnit's try-catch infrastructure now uses vfork_done, which is always set to a valid completion when a kthread is created, but which is set to NULL once the thread terminates. This creates a race condition, where the kthread exits before we can wait on it. Keep a copy of vfork_done, which is taken before we wake_up_process() and so valid, and wait on that instead. Fixes: 9353399 ("kunit: Handle test faults") Reported-by: Linux Kernel Functional Testing <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Tested-by: Linux Kernel Functional Testing <[email protected]> Acked-by: Mickaël Salaün <[email protected]> Signed-off-by: David Gow <[email protected]> Reviewed-by: Rae Moar <[email protected]> Tested-by: Miguel Ojeda <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
- Loading branch information