futex: Handle the correct robust list at compat_exit_robust_list()
André Almeida
reviewerPATCH 1/1 futex: Handle the correct robust list at compat_exit_robust_list()
compat_exit_robust_list(), as exit_robust_list(), should handle the robust list from the task_struct from the function argument, not the current task running the function.
--- kernel/futex/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/futex/core.c +1 -1
@@ -1256,7 +1256,7 @@ compat_fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **ent*/ static void compat_exit_robust_list (struct task_struct *curr) { -struct compat_robust_list_head __user *head = current->futex.compat_robust_list; +struct compat_robust_list_head __user *head = curr->futex.compat_robust_list;unsigned int limit =ROBUST_LIST_LIMIT , cur_mod, next_mod, pend_mod;struct robust_list __user *entry, *next_entry, *pending;compat_uptr_t uentry, next_uentry, upending;
Signature · 1 line
2.55.0
Thomas Gleixner
maintainerQuoted 5 lines · André Almeida
compat_exit_robust_list(), asexit_robust_list(), should handle the robust list from thetask_structfrom the function argument, not the current task running the function.Fixes 2cb5251d3d64 ("futex: Provide UABI defines for robust list entry modifiers")
It actually fixes nothing because *curr is always current.
I'd rather get rid of the argument alltogether because that's just a source of confusion.
Thanks,
tglx
André Almeida
reviewerEm 29/09/2026 05:22, Thomas Gleixner escreveu:
Quoted 5 lines · André Almeida
Quoted 4 lines
compat_exit_robust_list(), asexit_robust_list(), should handle the robust list from thetask_structfrom the function argument, not the current task running the function.
Quoted 7 lines
Quoted 1 line
Fixes 2cb5251d3d64 ("futex: Provide UABI defines for robust list entry modifiers")It actually fixes nothing because *curr is always current.
I'd rather get rid of the argument alltogether because that's just a source of confusion.
Ack, thanks for having a look.
Quoted 3 lines
Thanks,
tglx