From: sashiko-bot@kernel.org
To: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 3/3] perf: initialize and destroy error list in test__pmu_config_helpers()
Date: Thu, 05 Nov 2026 08:40:51 +0000 [thread overview]
Message-ID: <sashiko-outbox-198732@kernel.org> (raw)
In-Reply-To: <b9796c017042a3074956474a83c9b2170caec6db.1793867553.git.jirislaby@kernel.org>
> test__pmu_config_helpers() passes an uninitialized "err" to parse_events()
> without ever calling parse_events_error__init() on it first. Sashiko
> pointed this out in review:
> > When parse_events() fails and records an error via
> > parse_events_error__handle(), list_add(&entry->list, &err->list) and the
> > subsequent list_for_each_entry() walks in parse_events_error__print() and
> > parse_events_error__contains() will dereference the uninitialized err.list
> > pointers on the stack, and any allocated parse_events_error_entry objects
> > will be leaked.
>
> Fix it by calling parse_events_error__init(&err) before parse_events(), and
> by releasing the list with parse_events_error__exit(&err) on the new
> err_out_errlist path taken once the list has been initialized.
>
> Assisted-by: LLM
> Fixes: 8e2ef85c66dc ("perf tests: Test evsel__set_config_if_unset() and config change tracking")
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/8b245572903b8c4ed0dc569d7a71a8f4974e2455.1793867553.git.jirislaby@kernel.org?part=3
next prev parent reply other threads:[~2026-11-05 8:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1793867553.git.jirislaby@kernel.org>
2026-11-05 8:33 ` [PATCH v2 1/3] perf: do not call zfree() on uninitialized pointer Jiri Slaby (SUSE)
2026-11-05 8:41 ` sashiko-bot
2026-11-05 11:29 ` James Clark
2026-11-10 2:53 ` Namhyung Kim
2026-11-05 8:33 ` [PATCH v2 2/3] perf: do not call list_for_each_entry_safe() on uninitalized list Jiri Slaby (SUSE)
2026-11-05 8:42 ` sashiko-bot
2026-11-05 11:20 ` James Clark
2026-11-05 8:33 ` [PATCH v2 3/3] perf: initialize and destroy error list in test__pmu_config_helpers() Jiri Slaby (SUSE)
2026-11-05 8:40 ` sashiko-bot [this message]
2026-11-05 11:25 ` James Clark
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=sashiko-outbox-198732@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=jirislaby@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.