Skip to content

futex: Add error coverage tests for wait, wake and cmp_requeue#1301

Open
AshWizard wants to merge 4 commits into
linux-test-project:masterfrom
AshWizard:futex-add-error-coverage
Open

futex: Add error coverage tests for wait, wake and cmp_requeue#1301
AshWizard wants to merge 4 commits into
linux-test-project:masterfrom
AshWizard:futex-add-error-coverage

Conversation

@AshWizard
Copy link
Copy Markdown

@AshWizard AshWizard commented Mar 29, 2026

Improve error handling coverage for futex syscalls by adding tests for missing error conditions that were previously untested.

futex_wait06 verifies EFAULT is returned when uaddr or timeout points to unmapped memory.

futex_wait07 verifies EINTR is returned when futex_wait() is interrupted by a signal.

futex_wake05 verifies EFAULT is returned when uaddr points to unmapped or PROT_NONE memory.

futex_cmp_requeue03 verifies EFAULT is returned when uaddr or uaddr2 points to unmapped memory, and EACCES or EFAULT when uaddr points to memory without read permission (PROT_NONE). The EACCES behavior was introduced in kernel 5.9.

@AshWizard AshWizard force-pushed the futex-add-error-coverage branch 2 times, most recently from 3757c2d to e52b2c4 Compare April 19, 2026 13:04
@AshWizard AshWizard force-pushed the futex-add-error-coverage branch 7 times, most recently from aadbca5 to 00edfb0 Compare May 26, 2026 15:26
AshWizard added 4 commits May 27, 2026 00:46
futex(FUTEX_WAIT) has no existing test for EFAULT. Add coverage for
the cases where uaddr points to unmapped memory and where the timeout
pointer is invalid.

Signed-off-by: Michael Menasherov <mmenashe@redhat.com>
futex(FUTEX_WAIT) has no existing test for EINTR. Add coverage for
the case where the wait is interrupted by a signal before the futex
word changes.

Signed-off-by: Michael Menasherov <mmenashe@redhat.com>
futex(FUTEX_WAKE) has no existing test for EFAULT. Add coverage for
the cases where uaddr points to unmapped or PROT_NONE memory.

Signed-off-by: Michael Menasherov <mmenashe@redhat.com>
futex(FUTEX_CMP_REQUEUE) has no existing test for EFAULT. Add coverage
for the cases where uaddr or uaddr2 points to unmapped or inaccessible
(PROT_NONE) memory.

Signed-off-by: Michael Menasherov <mmenashe@redhat.com>
@AshWizard AshWizard force-pushed the futex-add-error-coverage branch from 00edfb0 to 27b4a03 Compare May 26, 2026 21:51
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