[LTP] [PATCH v10 3/3] coredump02: Verify ELF structure and notes

Cyril Hrubis chrubis@suse.cz
Thu Sep 10 12:21:31 CEST 2026


Hi!
> +static void handle_note(uint32_t type, const void *desc, size_t descsz, pid_t pid)
> +{
> +	if (type == NT_PRPSINFO && descsz >= sizeof(struct elf_prpsinfo)) {
> +		struct elf_prpsinfo info;
> +
> +		memcpy(&info, desc, sizeof(info));
> +		TST_EXP_EQ_STR(info.pr_fname, "coredump02");

I still do not see a reason why this can't be:

		struct elf_prpsinfo *info = desc;

		TST_EXP_EQ_STR(info->pr_name, "coredump02");

> +		prpsinfo_seen = 1;
> +	} else if (type == NT_PRSTATUS && descsz >= sizeof(struct elf_prstatus)) {
> +		struct elf_prstatus st;
> +
> +		memcpy(&st, desc, sizeof(st));
> +
> +		TST_EXP_EQ_LI(st.pr_pid, pid);
> +		TST_EXP_EQ_LI(st.pr_cursig, SIGABRT);

And here as well.


Otherwise:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list