mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "André Almeida" <andrealmeid@igalia.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-kernel@vger.kernel.org
Cc: Calvin Owens <calvin@wbinvd.org>,
	Darren Hart <dvhart@infradead.org>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] futex: Initialize futex_phash_new during fork().
Date: Mon, 23 Jun 2025 13:27:22 -0300	[thread overview]
Message-ID: <ca0dab04-7ccc-43e6-b5f3-7a739c867bc0@igalia.com> (raw)
In-Reply-To: <20250623083408.jTiJiC6_@linutronix.de>

Em 23/06/2025 05:34, Sebastian Andrzej Siewior escreveu:
> During a hash resize operation the new private hash is stored in
> mm_struct::futex_phash_new if the current hash can not be immediately
> replaced.
> 
> The new hash must not be copied during fork() into the new task. Doing
> so will lead to a double-free of the memory by the two tasks.
> 
> Initialize the mm_struct::futex_phash_new during fork().
> 
> Reported-by: Calvin Owens <calvin@wbinvd.org>
> Closes: https://lore.kernel.org/all/aFBQ8CBKmRzEqIfS@mozart.vkv.me/
> Tested-by: Calvin Owens <calvin@wbinvd.org>
> Fixes: bd54df5ea7cad ("futex: Allow to resize the private local hash")
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Reviewed-by: André Almeida <andrealmeid@igalia.com>


  parent reply	other threads:[~2025-06-23 16:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23  8:34 Sebastian Andrzej Siewior
2025-06-23 13:04 ` [tip: locking/urgent] " tip-bot2 for Sebastian Andrzej Siewior
2025-06-23 16:27 ` André Almeida [this message]
2025-06-23 16:37 ` [PATCH] " Davidlohr Bueso

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=ca0dab04-7ccc-43e6-b5f3-7a739c867bc0@igalia.com \
    --to=andrealmeid@igalia.com \
    --cc=bigeasy@linutronix.de \
    --cc=calvin@wbinvd.org \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®