[PATCH v3 5/5] arm64: vdso32: Implement __vdso_futex_robust_try_unlock()

Thomas Weißschuh linux at weissschuh.net
Tue Jun 2 01:30:28 PDT 2026


On 2026-05-29 13:33:57-0300, André Almeida wrote:
> Based on aarch64 implementation, provide a 32 bit entry point for this vDSO.
> 
> In order to keep compatibility with arm64_futex_robust_unlock_get_pop(),
> make sure to store the pop address at r2.
> 
> Signed-off-by: André Almeida <andrealmeid at igalia.com>
> ---
>  arch/arm64/kernel/vdso.c            |  9 +++++++++
>  arch/arm64/kernel/vdso32/Makefile   |  2 +-
>  arch/arm64/kernel/vdso32/vdso.lds.S |  5 +++++
>  arch/arm64/kernel/vdso32/vfutex.c   | 33 +++++++++++++++++++++++++++++++++
>  4 files changed, 48 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
> index 76f22ea8e181..3ce9d9d79431 100644
> --- a/arch/arm64/kernel/vdso.c
> +++ b/arch/arm64/kernel/vdso.c
> @@ -71,6 +71,15 @@ static void vdso_futex_robust_unlock_update_ips(enum vdso_abi abi, struct mm_str
>  
>  		futex_set_vdso_cs_range(fd, 0, success, end, false);
>  	}
> +
> +#ifdef CONFIG_COMPAT_VDSO
> +	if (abi == VDSO_ABI_AA32) {
> +		success = (uintptr_t) VDSO_SYMBOL(vdso, futex_list32_try_unlock_cs_success);
> +		end = (uintptr_t) VDSO_SYMBOL(vdso, futex_list32_try_unlock_cs_end);
> +
> +		futex_set_vdso_cs_range(fd, 1, success, end, true);

Should also be idx = 0, I think.

> +	}
> +#endif
>  }
>  #else
>  static inline void vdso_futex_robust_unlock_update_ips(enum vdso_abi abi, struct mm_struct *mm) { }
> diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
> index 2775843e53cd..cc4248539bec 100644
> --- a/arch/arm64/kernel/vdso32/Makefile
> +++ b/arch/arm64/kernel/vdso32/Makefile
> @@ -97,7 +97,7 @@ VDSO_LDFLAGS += --orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL)
>  munge := ../../../arm/vdso/vdsomunge
>  hostprogs := $(munge)
>  
> -c-obj-vdso := note.o
> +c-obj-vdso := note.o vfutex.o

#ifdef CONFIG_FUTEX_ROBUST_UNLOCK

>  c-obj-vdso-gettimeofday := vgettimeofday.o
>  
>  ifneq ($(c-gettimeofday-y),)
> diff --git a/arch/arm64/kernel/vdso32/vdso.lds.S b/arch/arm64/kernel/vdso32/vdso.lds.S
> index c374fb0146f3..31e0a3770c32 100644
> --- a/arch/arm64/kernel/vdso32/vdso.lds.S
> +++ b/arch/arm64/kernel/vdso32/vdso.lds.S
> @@ -87,6 +87,11 @@ VERSION
>  		__vdso_clock_getres;
>  		__vdso_clock_gettime64;
>  		__vdso_clock_getres_time64;
> +		__vdso_futex_robust_list32_try_unlock;

#ifdef CONFIG_FUTEX_ROBUST_UNLOCK

>  	local: *;
>  	};
>  }
> +
> +VDSO_futex_list32_try_unlock_cs_success = __futex_list32_try_unlock_cs_success;
> +VDSO_futex_list32_try_unlock_cs_start = __futex_list32_try_unlock_cs_start;
> +VDSO_futex_list32_try_unlock_cs_end = __futex_list32_try_unlock_cs_end;

When support for 32-bit robust lists will be added to the 64-bit vDSO
then both vDSOs will have these symbols and they will conflict.
Maybe add VDSO32_SYMBOL() which uses a different namespace than the
regular VDSO_SYMBOL(). And teach gen_vdso_offsets.sh to use that
namespace.

(...)


Thomas



More information about the linux-arm-kernel mailing list