[GIT PULL] futex fix

Ingo Molnar posted 1 patch 1 month, 3 weeks ago
There is a newer version of this series
kernel/futex/core.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[GIT PULL] futex fix
Posted by Ingo Molnar 1 month, 3 weeks ago
Linus,

Please pull the latest locking/urgent Git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-urgent-2026-08-08

   # HEAD: 8e7ff730dd96519a333d1570edf1c3fabb6d3629 futex: Fix race in futex_pivot_pending() during private hash resize

 - Fix race in futex_pivot_pending() during private hash resize
   that can cause stuck tasks (Yao Kai)

Thanks,

	Ingo

------------------>
Yao Kai (1):
      futex: Fix race in futex_pivot_pending() during private hash resize


 kernel/futex/core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index 2650d1e52803..128c5752f225 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -1783,14 +1783,15 @@ void futex_hash_free(struct mm_struct *mm)
 
 static bool futex_pivot_pending(struct mm_struct *mm)
 {
+	struct futex_mm_phash *mmph = &mm->futex.phash;
 	struct futex_private_hash *fph;
 
-	guard(rcu)();
+	guard(mutex)(&mmph->lock);
 
-	if (!mm->futex.phash.hash_new)
+	if (!mmph->hash_new)
 		return true;
 
-	fph = rcu_dereference(mm->futex.phash.hash);
+	fph = rcu_dereference_raw(mmph->hash);
 	return futex_ref_is_dead(fph);
 }
Re: [GIT PULL] futex fix
Posted by pr-tracker-bot@kernel.org 1 month, 3 weeks ago
The pull request you sent on Sat, 8 Aug 2026 21:42:04 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-urgent-2026-08-08

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/d4eee3bdb8af1010a0c1edf571c00a7f41c5abe3

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html