Skip to content

FUTEX_WAKE_OP: use atomic read-modify-write memory access#2147

Open
francescolavra wants to merge 2 commits intomasterfrom
fix/futex
Open

FUTEX_WAKE_OP: use atomic read-modify-write memory access#2147
francescolavra wants to merge 2 commits intomasterfrom
fix/futex

Conversation

@francescolavra
Copy link
Member

In a FUTEX_WAKE_OP futex operation, the kernel modifies the memory pointed to by the 'uaddr2' argument; according to the Linux ABI, this modification must be done using atomic machine instructions.
In addition, the syscall should return an error if the op value extracted from the val3 argument is not a known value.

Thanks to Niklas Femerstrand (@niklasfemerstrand) for reporting the race condition caused by non-atomic memory accesses.

Francesco Lavra added 2 commits March 15, 2026 19:58
In the op value extracted from the val3 argument is not a known value,
Linux returns -ENOSYS.
In a FUTEX_WAKE_OP futex operation, the kernel modifies the memory pointed
to by the 'uaddr2' argument; according to the Linux ABI, this modification
must be done using atomic machine instructions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant