Re: [PATCH Next] copy_process(): Fixed jump logic error

From: Vlastimil Babka

Date: Fri Sep 26 2025 - 11:11:15 EST


On 9/24/25 14:06, Edward Adam Davis wrote:
> After futex_hash_allocate_default() fails, the logic should jump to
> bad_fork_cancel_cgroup, not bad_fork_core_free.
>
> Jumping to bad_fork_core_free would cause a siglock imbalance.
>
> Signed-off-by: Edward Adam Davis <eadavis@xxxxxx>

Sebastian already fixed this and it's in tip: locking/urgent

https://lore.kernel.org/all/20250918130945.-7SIRk8Z@xxxxxxxxxxxxx/

> ---
> kernel/fork.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index e9a7fb5c3e49..a0b8eeeb1d27 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -2349,7 +2349,7 @@ __latent_entropy struct task_struct *copy_process(
> if (need_futex_hash_allocate_default(clone_flags)) {
> retval = futex_hash_allocate_default();
> if (retval)
> - goto bad_fork_core_free;
> + goto bad_fork_cancel_cgroup;
> /*
> * If we fail beyond this point we don't free the allocated
> * futex hash map. We assume that another thread will be created