From: sashiko-bot@kernel.org
To: "Athira Rajeev" <atrajeev@linux.ibm.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 1/9] tool/perf: Move auxtrace_record__init for powerpc-vpadtl as separate utility
Date: Wed, 01 Jul 2026 08:56:30 +0000 [thread overview]
Message-ID: <20260701085631.1964F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260701084115.80383-2-atrajeev@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Memory allocation failure in vpa_dtl_recording_init silently returns success, masking -ENOMEM and causing a subsequent NULL pointer dereference.
- [Low] Missing explicit inclusion of POSIX standard headers <stdlib.h> and <limits.h> breaks musl libc compatibility.
--
(Note: The format of this report is altered to provide a free-form summary of the findings, rather than inline diff comments, due to system recitation restrictions.)
commit 9f7d3d8f8dc04ee94edc0507b7b561997e9bd6a5
Author: Athira Rajeev <atrajeev@linux.ibm.com>
tool/perf: Move auxtrace_record__init for powerpc-vpadtl as separate utility
This commit extracts the auxtrace_record__init logic for powerpc-vpadtl into a
separate utility file, vpa-dtl.c, allowing other PMUs to share the auxtrace
infrastructure.
[Severity: High]
When zalloc() fails in the new vpa_dtl_recording_init() function, it returns
NULL. However, because the refactored function no longer takes the err pointer
argument, it cannot propagate the -ENOMEM error back up the stack.
In auxtrace_record__init(), the err variable is initially set to 0. If
vpa_dtl_recording_init() returns NULL due to memory exhaustion,
auxtrace_record__init() will also return NULL while leaving the error code
as 0 (success).
Could this regression lead to memory corruption or crashes? Since
pos->needs_auxtrace_mmap is already set to true earlier in the function,
the caller will see a success code and incorrectly proceed to map the auxtrace
buffer. Eventually, this reaches __auxtrace_mmap__read(), which evaluates
itr->alignment. If itr is NULL because of the masked allocation failure, won't
this trigger a NULL pointer dereference?
[Severity: Low]
The newly added file tools/perf/arch/powerpc/util/vpa-dtl.c uses the POSIX
function free() in powerpc_vpadtl_free() and the constant UINT_MAX in
powerpc_vpadtl_recording_options().
Are we missing some required include directives here? The file doesn't seem to
explicitly include stdlib.h or limits.h. While this might compile fine under
glibc due to implicit header inclusions, does this regression break compilation
on stricter libc implementations like musl?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260701084115.80383-1-atrajeev@linux.ibm.com?part=1
next prev parent reply other threads:[~2026-07-01 8:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 8:41 [PATCH 0/9] tools/perf: Add interface to expose HTM trace data via perf Athira Rajeev
2026-07-01 8:41 ` [PATCH 1/9] tool/perf: Move auxtrace_record__init for powerpc-vpadtl as separate utility Athira Rajeev
2026-07-01 8:56 ` sashiko-bot [this message]
2026-07-01 8:41 ` [PATCH 2/9] tools/perf: Add CONFIG_AUXTRACE support for HTM pmu on powerpc Athira Rajeev
2026-07-01 8:55 ` sashiko-bot
2026-07-01 8:41 ` [PATCH 3/9] tools/perf: Add arch_record__collect_final_data to collect additional data before closing the event Athira Rajeev
2026-07-01 8:54 ` sashiko-bot
2026-07-01 8:41 ` [PATCH 4/9] tools/perf: Add powerpc callback support for arch_record__collect_final_data Athira Rajeev
2026-07-01 8:55 ` sashiko-bot
2026-07-01 8:41 ` [PATCH 5/9] tools/perf: process htm auxtrace events and display in perf report -D Athira Rajeev
2026-07-01 9:05 ` sashiko-bot
2026-07-01 8:41 ` [PATCH 6/9] perf tools powerpc: Add HTM trace data processing and decoding support Athira Rajeev
2026-07-01 9:06 ` sashiko-bot
2026-07-01 8:41 ` [PATCH 7/9] perf tools powerpc: Add physical to logical address mapping for HTM traces Athira Rajeev
2026-07-01 9:07 ` sashiko-bot
2026-07-01 8:41 ` [PATCH 8/9] tools/perf/powerpc: Add event name as htm of PERF_TYPE_SYNTH type to present htm samples Athira Rajeev
2026-07-01 9:12 ` sashiko-bot
2026-07-01 8:41 ` [PATCH 9/9] tools/perf/powerpc: Add logical address in decoded traces Athira Rajeev
2026-07-01 9:13 ` sashiko-bot
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=20260701085631.1964F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=atrajeev@linux.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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