linux-stable/kernel/futex
Ben Wolsieffer c73801ae4f futex: Don't include process MM in futex key on no-MMU
On no-MMU, all futexes are treated as private because there is no need
to map a virtual address to physical to match the futex across
processes. This doesn't quite work though, because private futexes
include the current process's mm_struct as part of their key. This makes
it impossible for one process to wake up a shared futex being waited on
in another process.

Fix this bug by excluding the mm_struct from the key. With
a single address space, the futex address is already a unique key.

Fixes: 784bdf3bb6 ("futex: Assume all mappings are private on !MMU systems")
Signed-off-by: Ben Wolsieffer <ben.wolsieffer@hefring.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: André Almeida <andrealmeid@igalia.com>
Link: https://lore.kernel.org/r/20231019204548.1236437-2-ben.wolsieffer@hefring.com
2023-10-27 11:53:42 +02:00
..
core.c futex: Don't include process MM in futex key on no-MMU 2023-10-27 11:53:42 +02:00
futex.h futex: Add flags2 argument to futex_requeue() 2023-09-21 19:22:09 +02:00
Makefile futex: Split out wait/wake 2021-10-07 13:51:11 +02:00
pi.c futex: Propagate flags into get_futex_key() 2023-09-21 19:22:09 +02:00
requeue.c futex/requeue: Remove unnecessary ‘NULL’ initialization from futex_proxy_trylock_atomic() 2023-10-04 18:04:47 +02:00
syscalls.c futex: Add sys_futex_requeue() 2023-09-21 19:22:10 +02:00
waitwake.c futex: Propagate flags into get_futex_key() 2023-09-21 19:22:09 +02:00