[LTP] userfaultfd: Use two-step handshake to probe features

acervesato@ltp-agent acervesato@ltp-agent
Sat Apr 11 11:46:23 CEST 2026


Hi Ricardo,

our agent completed the review of the patch.

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.

On Sat, 11 Apr 2026 11:24:51 +0200, Ricardo Branco wrote:
> userfaultfd: Use two-step handshake to probe features

> +       if (!(uffdio_api.features & UFFD_FEATURE_PAGEFAULT_FLAG_WP))
> +               tst_brk(TCONF, "UFFD_FEATURE_PAGEFAULT_FLAG_WP not supported");
> +       SAFE_CLOSE(uffd);

tst_brk() longjmps out of run(), so SAFE_CLOSE never executes — close uffd
before calling tst_brk(). userfaultfd05.c also has no .cleanup, so the page
mmap from set_pages() leaks too; add .cleanup = reset_pages to struct tst_test.

[...]

> +       if (!(uffdio_api.features & UFFD_FEATURE_POISON))
> +               tst_brk(TCONF, "UFFD_FEATURE_POISON not supported");
> +       SAFE_CLOSE(uffd);

Same issue: close uffd before calling tst_brk().

Regards,
LTP AI Reviewer


More information about the ltp mailing list