Bug 2347756 (CVE-2022-49137)

Summary: CVE-2022-49137 kernel: drm/amd/amdgpu/amdgpu_cs: fix refcount leak of a dma_fence obj
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dfreiber, drow, jburrell, vkumar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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

drm/amd/amdgpu/amdgpu_cs: fix refcount leak of a dma_fence obj

This issue takes place in an error path in
amdgpu_cs_fence_to_handle_ioctl(). When `info->in.what` falls into
default case, the function simply returns -EINVAL, forgetting to
decrement the reference count of a dma_fence obj, which is bumped
earlier by amdgpu_cs_get_fence(). This may result in reference count
leaks.

Fix it by decreasing the refcount of specific object before returning
the error code.

Comment 1 Avinash Hanwate 2025-02-26 13:52:16 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022606-CVE-2022-49137-92fc@gregkh/T

Comment 4 Avinash Hanwate 2025-02-26 17:56:31 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022606-CVE-2022-49137-92fc@gregkh/T