All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Ricardo Branco <rbranco@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] userfaultfd: Minor fixes
Date: Tue,  5 May 2026 17:32:20 +0000	[thread overview]
Message-ID: <20260505173220.3999-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260505131538.21645-1-rbranco@suse.de>

Hi Ricardo,

On Tue, 5 May 2026 15:14:41 +0200, Ricardo Branco wrote:
> userfaultfd: Minor fixes
>
> - Use POSIX semantics for thread function
> - Set cleanup to call reset_pages
> - Use long for page_size and use unsigned cast
> - Call the SAFE_ versions of some system calls
> - Use TFAIL consistently for unexpected UFFD_EVENTs

The body only lists what was changed, not why. Please add at least a
sentence per item explaining the problem: e.g. the thread function had
the wrong signature (UB when cast to pthread start routine), missing
.cleanup caused leaks on early abort, int page_size causes sign-extension
in the bitwise address mask, etc.

> -static void *handle_thread(void)
> +static void *handle_thread(void *arg LTP_ATTRIBUTE_UNUSED)
>
> -       tst_brk(TBROK | TERRNO, "Received unexpected UFFD_EVENT %d", msg.event);
> +       tst_brk(TFAIL, "Received unexpected UFFD_EVENT %d", msg.event);
>
> -       page_size = sysconf(_SC_PAGE_SIZE);
> +       page_size = SAFE_SYSCONF(_SC_PAGE_SIZE);
> +       .cleanup = reset_pages,

These are five distinct fix categories (thread signature, resource
management, type correctness, SAFE-macro adoption, result-code change).
Please split them into focused commits so each can be reviewed and
bisected independently.

Pre-existing issues noticed in the surrounding code (not introduced
by this patch):

- userfaultfd04.c (and similar): early-return TFAIL path skips
  SAFE_PTHREAD_JOIN, leaving the handler thread un-joined.
- userfaultfd03.c: .needs_root = 1 may be unnecessary since
  /dev/userfaultfd was designed for unprivileged access.

---
Note:

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.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-05-05 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05 13:14 [LTP] [PATCH v4] userfaultfd: Minor fixes Ricardo Branco
2026-05-05 17:32 ` linuxtestproject.agent [this message]
2026-05-06 10:55 ` Andrea Cervesato via ltp
2026-05-06 11:22   ` Andrea Cervesato via ltp
2026-05-06 11:23   ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260505173220.3999-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=rbranco@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.