From: David Hildenbrand <david@redhat.com>
To: Edward Adam Davis <eadavis@qq.com>, kees@kernel.org
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
vschneid@redhat.com, akpm@linux-foundation.org,
lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
mhocko@suse.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH Next] copy_process(): Fixed jump logic error
Date: Wed, 24 Sep 2025 14:29:00 +0200 [thread overview]
Message-ID: <2dcffe42-141b-40fc-9bc1-b61a1ed7d74f@redhat.com> (raw)
In-Reply-To: <tencent_5E4F978D9525A58D97925ADDBADDB2193107@qq.com>
On 24.09.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@qq.com>
If it's still only in -next (which I assume when looking at the Next
tag), into which patch should this fixup get squashed?
Or is this already upstream and we want actually Fixes: and CC stable?
(staring at current master, this seems to be an upstream problem?)
> ---
> 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
Makes me wonder whether we would have to undo anything the
sched_cgroup_fork() did, or if that cleanup is implied in
bad_fork_cancel_cgroup. Without digging too deep into the code, I assume
the latter.
--
Cheers
David / dhildenb
next prev parent reply other threads:[~2025-09-24 12:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 12:06 Edward Adam Davis
2025-09-24 12:29 ` David Hildenbrand [this message]
2025-09-26 15:11 ` Vlastimil Babka
2025-09-26 15:21 ` Sebastian Andrzej Siewior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2dcffe42-141b-40fc-9bc1-b61a1ed7d74f@redhat.com \
--to=david@redhat.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=eadavis@qq.com \
--cc=juri.lelli@redhat.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mgorman@suse.de \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox