[PATCH] futex: Handle the correct robust list at compat_exit_robust_list()

André Almeida posted 1 patch 2 days, 16 hours ago
kernel/futex/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] futex: Handle the correct robust list at compat_exit_robust_list()
Posted by André Almeida 2 days, 16 hours ago
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")
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
 kernel/futex/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index a061f54b606d..42014dcfdf0c 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -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;
-- 
2.55.0