diff options
| author | Kyle Zeng <kylebot@openai.com> | 2026-08-07 17:07:03 +0200 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-08-10 10:07:53 +0200 |
| commit | 59b3732f95dda1fbd2234514d35f4fb6b5bb6d85 (patch) | |
| tree | f0b1518f99ca478d06cd998f1a8e59ed87b53612 /scripts/stackusage | |
| parent | 8e7ff730dd96519a333d1570edf1c3fabb6d3629 (diff) | |
| download | linux-59b3732f95dda1fbd2234514d35f4fb6b5bb6d85.tar.gz linux-59b3732f95dda1fbd2234514d35f4fb6b5bb6d85.zip | |
futex/pi: Reject cross-mm private futex owners
A private futex key borrows the waiter's mm without taking an mm_users
reference. Nevertheless, attach_to_pi_owner() currently accepts an owner
from a different address space and copies the private key into the owner's
PI state.
When that owner exits, exit_pi_state_list() uses the saved key to find the
hash bucket and acquires a reference to the waiter's private hash. If the
last user of the waiter's mm exits concurrently, futex_hash_free() frees
the hash while the owner still uses its bucket and reference.
Prevent this by validating in attach_to_pi_owner() that, for private
futexes, the owner mm and waiter mm are the same. Perform the check with
the owner's pi_lock held and after validating owner::futex::state to
serialize against a concurrent PI-state exit cleanup.
[ tglx: Amended comment ]
Fixes: 80367ad01d93 ("futex: Add basic infrastructure for local task local hash")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Assisted-by: Codex:gpt-5.6-sol
Cc: stable@vger.kernel.org
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
