Re: [patch V4 11/14] x86/vdso: Prepare for robust futex unlock support
From: André Almeida
Date: Wed May 27 2026 - 21:15:02 EST
Em 02/04/2026 12:21, Thomas Gleixner escreveu:
There will be a VDSO function to unlock non-contended robust futexes in
user space. The unlock sequence is racy vs. clearing the list_pending_op
pointer in the task's robust list head. To plug this race the kernel needs
to know the critical section window so it can clear the pointer when the
task is interrupted within that race window. The window is determined by
labels in the inline assembly.
Add these symbols to the vdso2c generator and use them in the VDSO VMA code
to update the critical section addresses in mm_struct::futex on (re)map().
The symbols are not exported to user space, but available in the debug
version of the vDSO.
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
A left a minor nit bellow, but
Reviewed-by: André Almeida <andrealmeid@xxxxxxxxxx>
---
V3: Rename the symbols once more
V2: Rename the symbols
---
[...]
@@ -80,6 +106,7 @@ static int vdso_mremap(const struct vm_s
vdso_fix_landing(image, new_vma);
current->mm->context.vdso = (void __user *)new_vma->vm_start;
+ vdso_futex_robust_unlock_update_ips();
return 0;
}
@@ -189,6 +216,8 @@ static int map_vdso(const struct vdso_im
current->mm->context.vdso = (void __user *)text_start;
current->mm->context.vdso_image = image;
No need for this empty space.
+ vdso_futex_robust_unlock_update_ips();
+
up_fail:
mmap_write_unlock(mm);
return ret;