Bug 2347886 (CVE-2022-49530) - CVE-2022-49530 kernel: drm/amd/pm: fix double free in si_parse_power_table()
Summary: CVE-2022-49530 kernel: drm/amd/pm: fix double free in si_parse_power_table()
Keywords:
Status: NEW
Alias: CVE-2022-49530
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-02-26 03:10 UTC by OSIDB Bzimport
Modified: 2025-03-16 13:25 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-02-26 03:10:13 UTC
In the Linux kernel, the following vulnerability has been resolved:

drm/amd/pm: fix double free in si_parse_power_table()

In function si_parse_power_table(), array adev->pm.dpm.ps and its member
is allocated. If the allocation of each member fails, the array itself
is freed and returned with an error code. However, the array is later
freed again in si_dpm_fini() function which is called when the function
returns an error.

This leads to potential double free of the array adev->pm.dpm.ps, as
well as leak of its array members, since the members are not freed in
the allocation function and the array is not nulled when freed.
In addition adev->pm.dpm.num_ps, which keeps track of the allocated
array member, is not updated until the member allocation is
successfully finished, this could also lead to either use after free,
or uninitialized variable access in si_dpm_fini().

Fix this by postponing the free of the array until si_dpm_fini() and
increment adev->pm.dpm.num_ps everytime the array member is allocated.

Comment 1 Avinash Hanwate 2025-02-26 20:52:27 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022612-CVE-2022-49530-e721@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.