[PATCH 0/2] futex: Docs and tests for robust futex unlock race

André Almeida posted 2 patches 1 week ago
There is a newer version of this series
Documentation/locking/robust-futex-ABI.rst         |  44 +++++
.../selftests/futex/functional/robust_list.c       | 203 +++++++++++++++++++++
tools/testing/selftests/futex/include/futextest.h  |   3 +
3 files changed, 250 insertions(+)
[PATCH 0/2] futex: Docs and tests for robust futex unlock race
Posted by André Almeida 1 week ago
Hi Thomas,

I have created two patches to be added to our series, please have a look. The
first one is a note for the robust list docs about the need to use a
vDSO/syscall to avoid the race condition (this should be added to the man page
in the future). The second one adds the new syscalls to the robust list
selftests, testing all available combinations.

Ideally I would like to inject some error to the vDSO test, so we can really
test the mechanism of it being interrupted and the kernel cleaning the
list_op_pending, using ASM injection or ptrace(), but I have left for a next
patch for now.

---
André Almeida (2):
      Documentation: futex: Add a note about robust list race condition
      selftests: futex: Add tests for robust release operations

 Documentation/locking/robust-futex-ABI.rst         |  44 +++++
 .../selftests/futex/functional/robust_list.c       | 203 +++++++++++++++++++++
 tools/testing/selftests/futex/include/futextest.h  |   3 +
 3 files changed, 250 insertions(+)
---
base-commit: 263b70d20d1145dcb857409d7a21c2473365a4ba
change-id: 20260326-tonyk-vdso_test-10281e3a8088

Best regards,
--  
André Almeida <andrealmeid@igalia.com>

Re: [PATCH 0/2] futex: Docs and tests for robust futex unlock race
Posted by Thomas Gleixner 1 week ago
Andre!

On Thu, Mar 26 2026 at 11:31, André Almeida wrote:
> I have created two patches to be added to our series, please have a look. The
> first one is a note for the robust list docs about the need to use a
> vDSO/syscall to avoid the race condition (this should be added to the man page
> in the future). The second one adds the new syscalls to the robust list
> selftests, testing all available combinations.

Very appreciated. I'll pick them up for the V3 posting I'm working on.

> Ideally I would like to inject some error to the vDSO test, so we can really
> test the mechanism of it being interrupted and the kernel cleaning the
> list_op_pending, using ASM injection or ptrace(), but I have left for a next
> patch for now.

Please sync with Sebastian. He wanted to look into this ptrace thing
too.

Thanks,

        tglx
Re: [PATCH 0/2] futex: Docs and tests for robust futex unlock race
Posted by Sebastian Andrzej Siewior 6 days, 11 hours ago
On 2026-03-26 17:38:13 [+0100], Thomas Gleixner wrote:
> > Ideally I would like to inject some error to the vDSO test, so we can really
> > test the mechanism of it being interrupted and the kernel cleaning the
> > list_op_pending, using ASM injection or ptrace(), but I have left for a next
> > patch for now.
> 
> Please sync with Sebastian. He wanted to look into this ptrace thing
> too.

I did send you something. I just need to figure out why the kernel side
is not updating it after the cmpxchg()…

> Thanks,
> 
>         tglx

Sebastian