From nobody Tue Dec 2 01:28:46 2025 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F074123A9A8; Sat, 22 Nov 2025 05:51:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.97.179.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763790680; cv=none; b=sRfC9wxmQZCBciDki/RYcRFZRe18bPu64cpn0J338RrF0adKl5nZ4/NJHsQQsAu1Tp1xU1xq7LwOC4004YCh0ZtayXwqjDcFMOEUSBTuFZUJ/Gy03n7PIG+37Ik+JBj30b3HFtJUpaqHNC49KDHVjZJA6HoiHhE3tPtzB56fo5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763790680; c=relaxed/simple; bh=/ZDJnQBlGNOSO0UEqHe5ew7N8SJnqbveSgGLUNHalYs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hnc5v0UJM4RNS+Jr6LGd8OshzqwP+21E2aNHIkUxbqXWCSYQ2dwqNCNbVO8DVxH4da3dHb0ZVvYAA0XxmVQJOH5qXG0mzDzPhxF/llAUhFdCr8p1vASjylc5PpLF/CbL278+zyaW/Q5WwteyE1KwCxpooidrz3ZAdEmVwkxKwdc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=lcdsX+19; arc=none smtp.client-ip=213.97.179.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="lcdsX+19" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GCIZbuTzPUqv8cOo26+OQpOYWfjT0BoJo6GaN8MM1i4=; b=lcdsX+19wsoj62dMx3773Pa7Pi mSFGS+JTRZ/10FW/T5WouKKsDcM4fON/X620huoSSoe2LpJoftx8/PuE6sEeFsDZvLhEKDllfj32I JZdBYzVlFAAN7L+85J4MIqXjigUQHiobXhq6pG0K0RQMmKWhhFAnR/qyGC7t8+b5nO2FYKAEvaYBg iPnlQjKPrYkrquw+z0gKuI1Wl/wb4oEiDccVPGR9sdoaHuGbbHI9lvBGUDDRM1z6zkvLbkdwjSkWy 1ovsSs8uw4McA5bxRLrlwrBmBXbpEGXv5BPxow45Th3zdYi7SMo/NT/SZCLM8Doju+fAKXvNcIOXv RH7WZmlw==; Received: from [187.101.0.152] (helo=[192.168.15.100]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1vMgWf-003xEt-Jf; Sat, 22 Nov 2025 06:51:13 +0100 From: =?utf-8?q?Andr=C3=A9_Almeida?= Date: Sat, 22 Nov 2025 02:50:44 -0300 Subject: [PATCH v6 2/9] futex: Make exit_robust_list32() unconditionally available for 64-bit kernels Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251122-tonyk-robust_futex-v6-2-05fea005a0fd@igalia.com> References: <20251122-tonyk-robust_futex-v6-0-05fea005a0fd@igalia.com> In-Reply-To: <20251122-tonyk-robust_futex-v6-0-05fea005a0fd@igalia.com> To: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , Arnd Bergmann , Sebastian Andrzej Siewior , Waiman Long , Ryan Houdek Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-api@vger.kernel.org, kernel-dev@igalia.com, =?utf-8?q?Andr=C3=A9_Almeida?= X-Mailer: b4 0.14.3 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=C3=A9 Almeida --- kernel/futex/core.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/kernel/futex/core.c b/kernel/futex/core.c index c99d7baab24e..136639897ff9 100644 --- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -31,7 +31,6 @@ * "The futexes are also cursed." * "But they come in a choice of three flavours!" */ -#include #include #include #include @@ -1213,12 +1212,12 @@ static void exit_robust_list(struct task_struct *cu= rr) } } =20 -#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 =3D ptr_to_compat(entry); - void __user *uaddr =3D compat_ptr(base + futex_offset); + u32 base =3D (u32)(unsigned long)(entry); + void __user *uaddr =3D (void __user *)(unsigned long)(base + futex_offset= ); =20 return uaddr; } @@ -1227,13 +1226,13 @@ static void __user *futex_uaddr(struct robust_list = __user *entry, * Fetch a robust-list pointer. Bit 0 signals PI futexes: */ static inline int -fetch_robust_entry32(compat_uptr_t *uentry, struct robust_list __user **en= try, - compat_uptr_t __user *head, unsigned int *pi) +fetch_robust_entry32(u32 *uentry, struct robust_list __user **entry, + u32 __user *head, unsigned int *pi) { if (get_user(*uentry, head)) return -EFAULT; =20 - *entry =3D compat_ptr((*uentry) & ~1); + *entry =3D (void __user *)(unsigned long)((*uentry) & ~1); *pi =3D (unsigned int)(*uentry) & 1; =20 return 0; @@ -1251,8 +1250,8 @@ static void exit_robust_list32(struct task_struct *cu= rr) struct robust_list __user *entry, *next_entry, *pending; unsigned int limit =3D ROBUST_LIST_LIMIT, pi, pip; unsigned int next_pi; - compat_uptr_t uentry, next_uentry, upending; - compat_long_t futex_offset; + u32 uentry, next_uentry, upending; + s32 futex_offset; int rc; =20 /* @@ -1412,7 +1411,7 @@ static void futex_cleanup(struct task_struct *tsk) tsk->robust_list =3D NULL; } =20 -#ifdef CONFIG_COMPAT +#ifdef CONFIG_64BIT if (unlikely(tsk->robust_list32)) { exit_robust_list32(tsk); tsk->robust_list32 =3D NULL; --=20 2.52.0