Bug 2301483 (CVE-2024-42118)

Summary: CVE-2024-42118 kernel: drm/amd/display: Do not return negative stream id for array
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: kernel 6.9.9, kernel 6.10 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the Linux kernel's drm/amd/display subsystem. The resource_stream_to_stream_idx function previously returned -1 when an index was not found, which is invalid for array indexing. This issue could lead to out-of-bounds access and unexpected negative return values.
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:
Bug Depends On: 2301784    
Bug Blocks:    

Description OSIDB Bzimport 2024-07-30 08:32:28 UTC
In the Linux kernel, the following vulnerability has been resolved:

drm/amd/display: Do not return negative stream id for array

[WHY]
resource_stream_to_stream_idx returns an array index and it return -1
when not found; however, -1 is not a valid array index number.

[HOW]
When this happens, call ASSERT(), and return a zero instead.

This fixes an OVERRUN and an NEGATIVE_RETURNS issues reported by Coverity.

Comment 1 Mauro Matteo Cascella 2024-07-30 19:10:08 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024073024-CVE-2024-42118-537b@gregkh/T

Comment 2 Mauro Matteo Cascella 2024-07-30 19:10:29 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2301784]