History

Merge tag 'locking-urgent-2026-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull futex fix from Ingo Molnar: - Fix race in futex_pivot_pending() during private hash resize that can cause stuck tasks (Yao Kai) * tag 'locking-urgent-2026-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: futex: Fix race in futex_pivot_pending() during private hash resize

Linus Torvalds committed 3 months ago

Commit d4eee3b2 parents 91a73db 8e7ff731 file · +4 −3Browse files

Unified · Split

kernel/futex/core.c+4−3
@@ -1783,14 +1783,15 @@ void futex_hash_free(struct mm_struct *mm) · 1782 unmodified lines
17831783
17841784 static bool futex_pivot_pending(struct mm_struct *mm)
17851785 {
1786+ struct futex_mm_phash *mmph = &mm->futex.phash;
17861787 struct futex_private_hash *fph;
17871788
1788− guard(rcu)();
1789+ guard(mutex)(&mmph->lock);
17891790
1790− if (!mm->futex.phash.hash_new)
1791+ if (!mmph->hash_new)
17911792 return true;
17921793
1793− fph = rcu_dereference(mm->futex.phash.hash);
1794+ fph = rcu_dereference_raw(mmph->hash);
17941795 return futex_ref_is_dead(fph);
17951796 }
17961797