Bug 2037790 (CVE-2022-0135)

Summary: CVE-2022-0135 virglrenderer: out-of-bounds write in read_transfer_data()
Product: [Other] Security Response Reporter: Michael Kaplan <mkaplan>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: airlied, marcandre.lureau, security-response-team, virt-maint
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
An out-of-bounds write issue was found in the VirGL virtual OpenGL renderer (virglrenderer). This flaw allows a malicious guest to create a specially crafted virgil resource and then issue a VIRTGPU_EXECBUFFER ioctl, leading to a denial of service or possible code execution.
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:
Bug Depends On: 2048607, 2048612, 2048606, 2048613    
Bug Blocks: 2037791, 2037795    

Description Michael Kaplan 2022-01-06 15:24:29 UTC
An out-of-bound write was found in virglrenderer in src/vrend_renderer.c:read_transfer_data().

Comment 2 Mauro Matteo Cascella 2022-01-31 15:35:22 UTC
Created virglrenderer tracking bugs for this issue:

Affects: epel-8 [bug 2048607]
Affects: fedora-all [bug 2048606]

Comment 5 Mauro Matteo Cascella 2022-01-31 17:35:34 UTC
The flaw arises from the fact that both vrend_renderer_transfer_write_iov() and read_transfer_data() calculate `send_size` to allocate a buffer and transfer data to it, respectively. However, they calculate the size in a slightly different way: vrend_renderer_transfer_write_iov() does not take `box->depth` into account. Under certain circumstances, this could lead to the allocation of a smaller heap buffer which is later accessed out-of-bounds by read_transfer_data.