On Thu, Apr 11, 2024 at 10:59 PM David Gow davidgow@google.com wrote:
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: 4de2a8e4cca4 ("kunit: Handle test faults") Reported-by: Linux Kernel Functional Testing lkft@linaro.org Closes: https://lore.kernel.org/lkml/20240410102710.35911-1-naresh.kamboju@linaro.or... Tested-by: Linux Kernel Functional Testing lkft@linaro.org Acked-by: Mickaël Salaün mic@digikod.net Signed-off-by: David Gow davidgow@google.com
I noticed it with the Rust tests too, and indeed this fixed it:
Tested-by: Miguel Ojeda ojeda@kernel.org
Thanks!
Cheers, Miguel