[LTP] lapi/prctl: add more fallback definitions
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Thu Aug 27 10:36:35 CEST 2026
Hi Andrea,
On Aug 26, 2026, Andrea Cervesato wrote:
> lapi/prctl: add more fallback definitions
--- [PATCH 1/2] ---
> +#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 {
Could the struct guard depend only on HAVE_STRUCT_PRCTL_MM_MAP? Since
PR_SET_MM_MAP is defined immediately above, !defined(PR_SET_MM_MAP) is always
false here. On systems missing struct prctl_mm_map, the fallback is therefore
not emitted and ghostlock.c fails to compile.
--- [PATCH 2/2] ---
> + map.start_code = map.start_data = map.end_data =
> + map.start_brk = map.brk = map.start_stack = map.arg_start =
> + map.arg_end = map.env_start = map.env_end = (uint64_t)(uintptr_t)&sz;
> + map.end_code = map.start_code + 0x1000;
Could this probe use the real process map values, as waiter_fn() does? A
successful PR_SET_MM_MAP call writes these values into current->mm. In
particular, start_brk and brk remain set to setup()'s local stack address
after setup() returns. A later brk() allocation below that address is rejected
as being below mm->start_brk, so pthread creation or another allocation can
fail for a reason unrelated to the CVE.
> +static struct tst_test test = {
> + .setup = setup,
> + .test_all = run,
> + .runtime = 180,
Could this declare .min_kver = "3.18", or otherwise treat EINVAL from
PR_SET_MM_MAP_SIZE as an unavailable prerequisite? PR_SET_MM_MAP was added in
Linux 3.18, while the CVE affects older kernels. On such a kernel,
SAFE_PRCTL() currently reports TBROK rather than TCONF.
> cve-2014-0196 cve-2016-7117 cve-2017-2671 cve-2017-17052 cve-2017-17053 refluxfs: CFLAGS += -pthread
> +cve-2014-0196 cve-2016-7117 cve-2017-2671 cve-2017-17052 cve-2017-17053 ghostlock: CFLAGS += -pthread
Could ghostlock be added to the existing assignment instead? The new line
passes -pthread twice to every pre-existing target listed there.
> refluxfs
> sctphantom
> +ghostlock
Could ghostlock be inserted in sorted order?
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