All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Leo Yan" <leo.yan@arm.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf/aux: Fix a memory leak on AUX allocation failure
Date: Mon, 09 Nov 2026 11:39:34 +0000	[thread overview]
Message-ID: <sashiko-outbox-204886@kernel.org> (raw)
In-Reply-To: <20261109-perf_fix_aux_page_memleak-v1-1-aae781d6749c@arm.com>

> rb_alloc_aux() allocates rb->aux_pages before allocating the AUX data
> pages. If the first rb_alloc_aux_page() call fails, rb->aux_nr_pages is
> still zero, so __rb_free_aux() skips freeing the pointer array.
> 
> Commit ee9397a6fb9bc ("perf: Fix double-free of the AUX buffer") added
> the aux_nr_pages guard because AUX cleanup and main ring buffer release
> shared an IRQ-work callback that could call __rb_free_aux() twice.
> 
> Since commit 95ff4ca26c49 ("perf/core: Free AUX pages in unmap path")
> removed that shared cleanup path, main ring buffer release no longer
> invokes AUX cleanup. The earlier double-free race is therefore gone, so
> the guard is no longer needed for freeing the pointer array.
> 
> Free rb->aux_pages unconditionally to cover the zero-page failure case.
> 
> Fixes: 95ff4ca26c49 ("perf/core: Free AUX pages in unmap path")
> Closes: https://sashiko.dev/#/bug/linux-c1a2bb3b-5d2a-4fca-a697-ce07992a5cc1
> Signed-off-by: Leo Yan <leo.yan@arm.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-perf_fix_aux_page_memleak-v1-1-aae781d6749c@arm.com?part=1


      reply	other threads:[~2026-11-09 11:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 11:31 [PATCH] perf/aux: Fix a memory leak on AUX allocation failure Leo Yan
2026-11-09 11:39 ` sashiko-bot [this message]

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-204886@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=leo.yan@arm.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 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.