From: sashiko-bot@kernel.org
To: "Priyank Rathod" <rathodpriyank@google.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v5 1/3] PCI/AER: Fix memory leak in aer_recover_queue() on kfifo buffer overflow
Date: Mon, 28 Sep 2026 17:46:39 +0000 [thread overview]
Message-ID: <20260928174640.39E9A1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928-b4-fix-aer-memleaks-v5-1-ba6b94c9c9a6@google.com>
> When ACPI APEI/GHES processes PCIe AER error records, it allocates memory
> for aer_capability_regs (aer_regs) from ghes_estatus_pool and passes it
> to aer_recover_queue() to be enqueued into aer_recover_ring.
>
> If kfifo_in_spinlocked() fails due to a buffer overflow,
> aer_recover_queue() logged an error message but returned without freeing
> aer_regs. Because the entry was rejected and never inserted into the
> queue, aer_recover_work_func() could never dequeue or free it, leaking
> the allocated ghes_estatus_pool memory.
>
> aer_recover_queue() returns void, so the caller ghes_handle_aer() cannot
> free the buffer itself: ownership is transferred to the AER code, which
> until now only released it on the success path.
>
> Free aer_regs via ghes_estatus_pool_region_free() when
> kfifo_in_spinlocked() fails on buffer overflow.
>
> Fixes: e2abc47a5a1a ("ACPI: APEI: Fix AER info corruption when error status data has multiple sections")
> Cc: stable@vger.kernel.org
> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Signed-off-by: Priyank Rathod <rathodpriyank@google.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260928-b4-fix-aer-memleaks-v5-0-ba6b94c9c9a6@google.com?part=1
next prev parent reply other threads:[~2026-09-28 17:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 17:40 [PATCH v5 0/3] PCI/AER: Fix ghes_estatus_pool memory leaks in error handling Priyank Rathod
2026-09-28 17:40 ` [PATCH v5 1/3] PCI/AER: Fix memory leak in aer_recover_queue() on kfifo buffer overflow Priyank Rathod
2026-09-28 17:46 ` sashiko-bot [this message]
2026-09-28 17:40 ` [PATCH v5 2/3] PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing Priyank Rathod
2026-09-28 17:46 ` sashiko-bot
2026-09-28 17:40 ` [PATCH v5 3/3] PCI/AER: Document that aer_recover_queue() takes ownership of aer_regs Priyank Rathod
2026-09-28 17:44 ` sashiko-bot
2026-10-06 17:13 ` Kuppuswamy Sathyanarayanan
2026-10-05 15:45 ` [PATCH v5 0/3] PCI/AER: Fix ghes_estatus_pool memory leaks in error handling Priyank Rathod
2026-10-05 23:27 ` Bjorn Helgaas
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=20260928174640.39E9A1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rathodpriyank@google.com \
--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