]> git.ipfire.org Git - thirdparty/linux.git/commit
futex: Add robust futex unlock IP range
authorThomas Gleixner <tglx@kernel.org>
Tue, 2 Jun 2026 09:09:59 +0000 (11:09 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 3 Jun 2026 09:38:51 +0000 (11:38 +0200)
commit042df0c1d48609a85580dcbaff498c95ced20a5f
treedec68717e0917a52adf84e5943c2fb762a2387c5
parent3ca9595d9fb6cce6633a5b03d98c2aecb5499838
futex: Add robust futex unlock IP range

There will be a VDSO function to unlock robust futexes in user space. The
unlock sequence is racy vs. clearing the list_pending_op pointer in the
tasks robust list head. To plug this race the kernel needs to know the
instruction window. As the VDSO is per MM the addresses are stored in
mm_struct::futex.

Architectures which implement support for this have to update these
addresses when the VDSO is (re)mapped and indicate the pending op pointer
size which is matching the IP.

Arguably this could be resolved by chasing mm->context->vdso->image, but
that's architecture specific and requires to touch quite some cache
lines. Having it in mm::futex reduces the cache line impact and avoids
having yet another set of architecture specific functionality.

To support multi size robust list applications (gaming) this provides two
ranges when COMPAT is enabled.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Link: https://patch.msgid.link/20260602090535.718926819@kernel.org
include/linux/futex.h
include/linux/futex_types.h
init/Kconfig
kernel/futex/core.c