Re: [PATCH] ACPICA: Fix memory leak at acpi_ds_create_field()

From: Rafael J. Wysocki (Intel)

Date: Thu Sep 24 2026 - 13:41:55 EST


On Thu, Sep 24, 2026 at 6:30 PM Matthew Wood <thepacketgeek@xxxxxxxxx> wrote:
>
> On Thu, Aug 13, 2026 at 03:39:37PM +0200, Rafael J. Wysocki (Intel) wrote:
> > On Thu, Aug 13, 2026 at 3:35 PM Breno Leitao <leitao@xxxxxxxxxx> wrote:
> > >
> > > acpi_ds_create_field() allocates internal_pcc_buffer for operation
> > > regions in the PCC address space.
> > >
> > > The function runs once per field, so a second field on the
> > > same region overwrites the pointer and orphans the previous buffer.
> > >
> > > The matching ACPI_FREE() in acpi_ut_delete_internal_obj() only ever sees
> > > the last one.
> > >
> > > An arm64 platform whose SSDT declares regions with multiple fields each
> > > leaks two buffers at boot, as detected by kmemleak:
> > >
> > > unreferenced object 0xffff000051e65400 (size 192):
> > > comm "swapper/0", pid 1, jiffies 4294668436
> > > backtrace (crc 0):
> > > __kmalloc_noprof
> > > acpi_ds_create_field
> > > acpi_ds_load2_end_op
> > > acpi_ds_exec_end_op
> > > acpi_ps_parse_loop
> > > acpi_ps_parse_aml
> > > acpi_ns_load_table
> > > acpi_load_tables
> > > acpi_init
> > >
> > > Do not allocate a region if it was previously allocated before,
> > > preserving the current design, but, not leaking memory.
> > >
> > > Fixes: 0acf24ad7e10 ("ACPICA: Add support for PCC Opregion special context data")
> > > Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
> >
> > As per Documentation/driver-api/acpi/linuxized-acpica.rst, please
> > submit a pull request with this change to the upstream ACPICA project
> > on GitHub. The Linux patch will become applicable when there is a
> > corresponding commit upstream.
> >
>
> Hi Rafael,
>
> This change has been submitted, approved, and merged in GitHub:
> https://github.com/open-acpica/acpica/commit/c71849d476bb5f97ca1867849e893368e12a69e6
>
> Can you please review here as well? Thank you.

So please resend it with a Link: tag pointing to the upstream ACPICA commit.