linux-stable/kernel/futex
Ben Wolsieffer d7bbdc9bf4 futex: Don't include process MM in futex key on no-MMU
[ Upstream commit c73801ae4f ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:58:53 +01:00
..
Makefile futex: Split out wait/wake 2021-10-07 13:51:11 +02:00
core.c futex: Don't include process MM in futex key on no-MMU 2023-11-20 11:58:53 +01:00
futex.h futex: add missing rtmutex.h include 2022-04-07 15:09:12 +02:00
pi.c futex: Remove a PREEMPT_RT_FULL reference. 2022-05-13 12:36:51 +02:00
requeue.c futex: Split out requeue 2021-10-07 13:51:10 +02:00
syscalls.c futex: Fix futex_waitv() hrtimer debug object leak on kcalloc error 2022-12-27 12:52:02 +01:00
waitwake.c freezer,sched: Rewrite core freezer logic 2022-09-07 21:53:50 +02:00