[LTP] coredump01: New core_pattern specifiers test

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Fri Sep 4 14:20:12 CEST 2026


Hi Andrea,

On Fri, 4 Sep 2026, Andrea Cervesato wrote:
> coredump01: New core_pattern specifiers test

--- [PATCH 1/2] ---

> static void run(unsigned int n)
> {
> 	if (n)
> 		verify_pipe_pattern();
> 	else
> 		verify_file_pattern();
> }
>
> static struct tst_test test = {
> 	.test = run,
> 	.tcnt = 2,

This manually dispatches separate functions for the two test cases. Use a
single struct tcase array and a generic .test callback, with
.tcnt = ARRAY_SIZE(tcases), as required for multi-case tests.

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

> 		} else if (ph[i].p_type == PT_LOAD) {
> 			have_load = 1;
> 		}

This only proves that a PT_LOAD header exists, not that its data is present.
A short dump_emit() after the headers and notes leaves WCOREDUMP set, so a
truncated core can pass every check here. Validate p_offset + p_filesz against
core_len with overflow-safe arithmetic for every file-backed segment.

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