https://bugzilla.kernel.org/show_bug.cgi?id=220177

            Bug ID: 220177
           Summary: Possible memory leak when initializing ACPI devices
           Product: ACPI
           Version: 2.5
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: ACPICA-Core
          Assignee: acpi_acpica-c...@kernel-bugs.osdl.org
          Reporter: shuhaof...@gmail.com
        Regression: No

Overview: 
In the function `acpi_ns_initialize_devices`, memory allocated to
`info.evaluate_info` will get leaked when the `ACPI_NO_ADDRESS_SPACE_INIT` flag
is not set and `acpi_ev_initialize_op_regions()` fails.

Detail: 
In the function `acpi_ns_initialize_devices`, `info.evaluate_info` gets
allocated with heap memory. When `acpi_ev_initialize_op_regions()` fails, the
function exits immediately after the goto statement, leaving
`info.evaluate_info` leaked.

Can `acpi_ev_initialize_op_regions` fail? 
The return value of `acpi_ev_initialize_op_regions` relies on the result of
`acpi_ut_acquire_mutex`. The result of `acpi_ut_acquire_mutex` further depends
on the result of `acpi_os_acquire_mutex`(a.k.a. `acpi_os_wait_semaphore`). The
`acpi_os_acquire_mutex` seems to be a platform-dependent function, and there
seems to be no guarantee that the semaphore will always be successfully
acquired.


Affected commit: (tag: v6.15) 0ff41df1cb268fc69e703a08a57ee14ae967d0ca
Commit date: May 25 2025

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
acpi-bugzilla mailing list
acpi-bugzilla@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acpi-bugzilla

Reply via email to