Skip to contentSkip to conversation

futex: Handle the correct robust list at compat_exit_robust_list()

PATCH In review André Almeida 2 participants 3 messages Sep 22 – Sep 29 Futex

lore
Share & tools
lore

André Almeida

author reviewer
#0 lore raw

PATCH 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.

Fixes 2cb5251d3d64 ("futex: Provide UABI defines for robust list entry modifiers")
---
 kernel/futex/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/futex/core.c +1 -1
index a061f54b606d..42014dcfdf0c 100644
@@ -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
maintainer
#1 lore raw
Quoted 5 lines · André Almeida

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.

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

author reviewer
#2 lore raw

Em 29/09/2026 05:22, Thomas Gleixner escreveu:

Quoted 5 lines · André Almeida
Quoted 4 lines

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.

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