From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: raoxu <raoxu@uniontech.com>
Cc: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] ACPI: property: Fix leaked buffers after skipped properties
Date: Fri, 13 Nov 2026 14:10:12 +0200 [thread overview]
Message-ID: <avb-JJur-yeedbFa@kekkonen.localdomain> (raw)
In-Reply-To: <DC796DD7AB1437C8+20261112090954.1388267-1-raoxu@uniontech.com>
Hi Rao,
Thanks for the patch.
On Thu, Nov 12, 2026 at 05:09:54PM +0800, raoxu wrote:
> From: Xu Rao <raoxu@uniontech.com>
>
> acpi_data_add_buffer_props() compacts successfully parsed buffer
> properties into an output package, but stores their separately allocated
> evaluation buffers in props->bufs using the original input index.
> acpi_free_device_properties() only frees entries below the output
> package's successful-property count.
>
> If a property is skipped because of an invalid format, invalid types or
> a failed object evaluation, later successful entries can be stored past
> the range visited during cleanup. For example, a failed first entry and
> a successful second entry leave the allocation in bufs[1] while cleanup
> only visits bufs[0]. The evaluation buffer is then leaked when the
> properties are destroyed. Lists with no skipped entries do not exhibit
> this mismatch.
>
> Store each evaluation buffer at the current output count before
> incrementing it. This keeps the ownership array compact and aligned with
> the cleanup bound without changing property order or buffer contents.
>
> Fixes: 103e10c69c61 ("ACPI: property: Add support for parsing buffer property UUID")
> Signed-off-by: Xu Rao <raoxu@uniontech.com>
> Cc: stable@vger.kernel.org
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> drivers/acpi/property.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 8ee5a1f0eb48..fb6b214f2335 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -523,7 +523,7 @@ static void acpi_data_add_buffer_props(acpi_handle handle,
> obj->buffer.length = buf_obj->buffer.length;
> obj->buffer.pointer = buf_obj->buffer.pointer;
>
> - props->bufs[i] = buf.pointer;
> + props->bufs[*count] = buf.pointer;
> package++;
> (*count)++;
> }
--
Kind regards,
Sakari Ailus
prev parent reply other threads:[~2026-11-13 12:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 9:09 raoxu
2026-11-13 12:10 ` Sakari Ailus [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=avb-JJur-yeedbFa@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=raoxu@uniontech.com \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®