From: "Anirban, Sk" <sk.anirban@intel.com>
To: <krishnaveni.palanisamy@intel.com>, <igt-dev@lists.freedesktop.org>
Cc: <kamil.konieczny@intel.com>, <riana.tauro@intel.com>,
<anshuman.gupta@intel.com>
Subject: Re: [PATCH] tests/intel/perf_pmu: Fix double free of drpc in test_rc6
Date: Wed, 9 Sep 2026 13:53:02 +0530 [thread overview]
Message-ID: <1b77f2c2-1826-4656-bb45-bf62747cae0a@intel.com> (raw)
In-Reply-To: <20260909062954.52564-1-krishnaveni.palanisamy@intel.com>
Hi Krishnaveni,
On 09-09-2026 11:59 am, krishnaveni.palanisamy@intel.com wrote:
> From: Krishnaveni Palanisamy <krishnaveni.palanisamy@intel.com>
>
> test_rc6() frees the 'drpc' buffer returned by igt_sysfs_get() at the
> end of each phase (initial wakeup, post-S3, post-idle) but leaves the
> pointer dangling. If a subsequent phase is skipped or returns early,
> the same pointer could be freed again, resulting in a
> "double free detected in tcache" abort from glibc when the test exits.
>
> Set drpc to NULL after each free() so the pointer cannot be reused
> accidentally.
>
> Signed-off-by: Krishnaveni Palanisamy <krishnaveni.palanisamy@intel.com>
> ---
> tests/intel/perf_pmu.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tests/intel/perf_pmu.c b/tests/intel/perf_pmu.c
> index 1e389958f..f48e1af57 100644
> --- a/tests/intel/perf_pmu.c
> +++ b/tests/intel/perf_pmu.c
> @@ -1766,6 +1766,7 @@ test_rc6(int gem_fd, unsigned int gt, unsigned int num_gt, unsigned int flags)
> ts[1] - ts[0],
> tolerance, drpc);
> free(drpc);
> + drpc=NULL;
spaces required around that '='
> }
>
> if (flags & TEST_S3) {
> @@ -1806,6 +1807,7 @@ test_rc6(int gem_fd, unsigned int gt, unsigned int num_gt, unsigned int flags)
> ts[1] - ts[0],
> tolerance, drpc);
> free(drpc);
> + drpc=NULL;
same
> }
>
> /* Wake up device and check no RC6. */
> @@ -1847,6 +1849,7 @@ test_rc6(int gem_fd, unsigned int gt, unsigned int num_gt, unsigned int flags)
> ts[1] - ts[0],
> tolerance, drpc);
> free(drpc);
> + drpc=NULL;
same here.
Thanks,
Anirban
> }
> }
>
next prev parent reply other threads:[~2026-09-09 8:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 6:29 [PATCH] tests/intel/perf_pmu: Fix double free of drpc in test_rc6 krishnaveni.palanisamy
2026-09-09 8:23 ` Anirban, Sk [this message]
2026-09-09 9:37 ` ✓ i915.CI.BAT: success for " Patchwork
2026-09-09 9:41 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-09 14:54 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-10 1:51 ` ✗ i915.CI.Full: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2026-09-09 5:52 [PATCH] " krishnaveni.palanisamy
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=1b77f2c2-1826-4656-bb45-bf62747cae0a@intel.com \
--to=sk.anirban@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@intel.com \
--cc=krishnaveni.palanisamy@intel.com \
--cc=riana.tauro@intel.com \
/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.