[LTP] sched_setattr01: Convert to new API
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Fri Sep 4 10:20:49 CEST 2026
Hi Andrea,
On Sep 4, 2026, Andrea Cervesato wrote:
> sched_setattr01: Convert to new API
--- [PATCH 1/5] ---
> Rewrite the test to use the modern LTP API (tst_test.h) with a
> struct tcase array and TST_EXP_* macros.
The body only restates how the test was converted. Please explain why the
conversion is needed.
--- [PATCH 2/5] ---
> Rewrite the test to use the modern LTP API (tst_test.h) with
> TST_EXP_* macros and cleanup callback.
The body only restates how the test was converted. Please explain why the
conversion is needed.
--- [PATCH 3/5] ---
> Add a safe variant of sched_setattr() that breaks the test with TBROK
> on failure and use it in sched_setattr01 and sched_getattr01.
The body describes the wrapper and its callers, but not why the shared
wrapper is needed. Please add the motivation.
> + if (ret == -1) {
> + tst_brk_(file, lineno, TBROK | TERRNO,
> + "sched_setattr(%i) failed", pid);
> + }
This body contains one statement. Please remove the braces as required by
LTP C style.
--- [PATCH 5/5] ---
> + TST_CHECKPOINT_WAKE(CP_SPRAYED);
> +
> + while (!tst_atomic_load(&stop_spray)) {
> + prctl(PR_SET_MM, PR_SET_MM_MAP, (unsigned long)&mm_map,
> + sizeof(mm_map), 0);
> + }
> + TST_CHECKPOINT_WAIT2(CP_SPRAYED, 18000);
> +
> + SAFE_SCHED_SETATTR(waiter_tid, &attr, 0);
CP_SPRAYED is signaled before the waiter enters PR_SET_MM_MAP, so nothing
ensures that sched_setattr() overlaps the controlled kernel-stack buffer.
Use the PoC's page-boundary and hole-punch mechanism, or an equivalent
mechanism that guarantees a usable overlap; otherwise a vulnerable kernel
can complete all attempts and incorrectly report TPASS.
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