[LTP] userfaultfd: Add tests for UFFDIO_RWPROTECT and UFFDIO_SET_MODE

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Sat Oct 24 22:22:05 CEST 2026


Hi Ricardo,

On 24 Oct 2026, Ricardo Branco wrote:
> userfaultfd: Add tests for UFFDIO_RWPROTECT and UFFDIO_SET_MODE

> +++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd08.c
> +	CHECK_UFFD_FEATURE(UFFD_FEATURE_RWP);
> +	uffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, false);
> +++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd09.c
> +	CHECK_UFFD_FEATURE(UFFD_FEATURE_RWP);
> +	CHECK_UFFD_FEATURE(UFFD_FEATURE_RWP_ASYNC);
> +	uffd = SAFE_USERFAULTFD(O_CLOEXEC | O_NONBLOCK, false);

Medium: With vm.unprivileged_userfaultfd=0 and no CAP_SYS_PTRACE, both
tests report TCONF even when RWP is supported, because CHECK_UFFD_FEATURE()
and run() request kernel-fault-capable descriptors.
These tests only need userspace faults; use UFFD_USER_MODE_ONLY or enable
the existing EPERM retry in both the feature probe and test descriptor
creation.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer


More information about the ltp mailing list