Linux Test Project
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] lapi/sched: add SAFE_SCHED_SETATTR()
Date: Wed,  2 Sep 2026 23:07:41 +0000	[thread overview]
Message-ID: <20260902230741.17215-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260902-cve-ghostlock-v5-1-569b9eb37941@suse.com>

Hi Andrea,

On Sep 2, 2026, Andrea Cervesato wrote:
> lapi/sched: add SAFE_SCHED_SETATTR()

--- [PATCH 1/3] ---

> static inline int safe_sched_setattr(const char *file, const int lineno,
> 				     pid_t pid, const struct sched_attr *attr,
> 				     unsigned int flags)
> {
> 	int ret;
>
> 	ret = sched_setattr(pid, attr, flags);

glibc's sched_setattr() takes a non-const struct sched_attr pointer, so this
discards const and fails with -Werror=discarded-qualifiers on the new glibc
API. Match that prototype here and in the fallback declaration.

> #define SAFE_SCHED_SETATTR(pid, attr, flags)\
> 	safe_sched_setattr(__FILE__, __LINE__, (pid), (attr), (flags))

This new public macro needs a kernel-doc comment documenting its arguments
and failure behavior.

--- [PATCH 2/3] ---

> #ifndef PR_SET_MM_MAP
> # define PR_SET_MM_MAP	14
> #endif
> #ifndef PR_SET_MM_MAP_SIZE
> # define PR_SET_MM_MAP_SIZE	15
> #endif
>
> #if !(HAVE_STRUCT_PRCTL_MM_MAP) && !defined(PR_SET_MM_MAP)
> struct prctl_mm_map {

The fallback struct is unreachable when needed because PR_SET_MM_MAP is
defined immediately before the condition. Gate it solely on
HAVE_STRUCT_PRCTL_MM_MAP, otherwise the new CVE test fails to compile on
systems lacking the struct.

--- [PATCH 3/3] ---

> static struct tst_test test = {
> 	.setup = setup,
> 	.test_all = run,
> 	.runtime = 180,
> 	.needs_checkpoints = 1,

PR_SET_MM_MAP was added in Linux 3.18. Add .min_kver = "3.18"; otherwise
3.3--3.17 kernels with both requested configs reach setup and report TBROK
for the unsupported operation.

> 	SAFE_CLOCK_GETTIME(CLOCK_MONOTONIC, &ts);
> 	ts = tst_timespec_add(ts, (struct timespec){ .tv_sec = 10, .tv_nsec = 0 });
> 	futex_wait_requeue_pi(&f_wait, &f_pi_target, &ts);
>
> 	TST_CHECKPOINT_WAKE(CP_SPRAYED);

The futex result is ignored, so expiry or another failure publishes
CP_SPRAYED without establishing the PI topology and causes a spurious TBROK.
Use an untimed blocking wait, or validate the result before the wake.

> refluxfs
> sctphantom
> ghostlock

Keep the new .gitignore entry sorted by placing ghostlock before refluxfs.

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

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

  reply	other threads:[~2026-09-02 23:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 21:25 [LTP] [PATCH v5 0/3] Reproducer for ghostlock Andrea Cervesato
2026-09-02 21:25 ` [LTP] [PATCH v5 1/3] lapi/sched: add SAFE_SCHED_SETATTR() Andrea Cervesato
2026-09-02 23:07   ` linuxtestproject.agent [this message]
2026-09-03  7:14     ` [LTP] " Andrea Cervesato via ltp
2026-09-02 21:25 ` [LTP] [PATCH v5 2/3] lapi/prctl: add more fallback definitions Andrea Cervesato
2026-09-02 21:25 ` [LTP] [PATCH v5 3/3] cve: add CVE-2026-43499 reproducer Andrea Cervesato
  -- strict thread matches above, loose matches on Subject: below --
2026-09-03  7:26 [LTP] [PATCH v6 1/3] lapi/sched: add SAFE_SCHED_SETATTR() Andrea Cervesato
2026-09-03 12:02 ` [LTP] " linuxtestproject.agent

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=20260902230741.17215-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=andrea.cervesato@suse.de \
    --cc=ltp@lists.linux.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox