[PATCH v7 03/10] futex: Make exit_robust_list32() unconditionally available for 64-bit kernels

From: André Almeida

Date: Fri Sep 25 2026 - 13:54:25 EST


The new syscall set_robust_list2() needs to handle both 64-bit and
32-bit robust lists, but not every 64-bit platform have compat entry
points. Make exit_robust_list32() unconditionally available for 64-bit
kernels regardless of having a compat configuration.

Signed-off-by: André Almeida <andrealmeid@xxxxxxxxxx>
---
kernel/futex/core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index 4b1bf211c3dc..6f01c27ae38b 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -1222,12 +1222,12 @@ static bool robust_list_clear_pending(unsigned long __user *pop)
return false;
}

-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_64BIT
static void __user *futex_uaddr(struct robust_list __user *entry,
compat_long_t futex_offset)
{
- compat_uptr_t base = ptr_to_compat(entry);
- void __user *uaddr = compat_ptr(base + futex_offset);
+ u32 base = (u32)(unsigned long)(entry);
+ void __user *uaddr = (void __user *)(unsigned long)(base + futex_offset);

return uaddr;
}
@@ -1260,8 +1260,8 @@ static void exit_robust_list32(struct task_struct *curr)
struct robust_list_head32 __user *head = curr->futex.robust_list32;
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;
- compat_long_t futex_offset;
+ u32 uentry, next_uentry, upending;
+ s32 futex_offset;
int rc;

/*
@@ -1464,7 +1464,7 @@ static void futex_cleanup(struct task_struct *tsk)
tsk->futex.robust_list = NULL;
}

-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_64BIT
if (unlikely(tsk->futex.robust_list32)) {
exit_robust_list32(tsk);
tsk->futex.robust_list32 = NULL;

--
2.55.0