Bug 2039003 (CVE-2022-0175)

Summary: CVE-2022-0175 virglrenderer: memory initialization issue in vrend_resource_alloc_buffer() can lead to info leak
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: airlied, marcandre.lureau, 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:
A flaw was found in the VirGL virtual OpenGL renderer (virglrenderer). The virgl did not properly initialize memory when allocating a host-backed memory resource. A malicious guest could use this flaw to mmap from the guest kernel and read this uninitialized memory from the host, possibly leading to information disclosure.
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: 2039343, 2039342, 2048503, 2048504    
Bug Blocks: 2039004, 2039007    

Description Pedro Sampaio 2022-01-10 17:52:24 UTC
The virgl forgets to initialize the memory pointed by the res->ptr when it
creates resource. And the memory can be mapped to the guest kernel when the
VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING is issued. However, the guest
userspace can read the data in the unintialized host memory by mmaping it
from the guest kernel.

Upstream fix:

https://gitlab.freedesktop.org/virgl/virglrenderer/-/commit/b05bb61f454eeb8a85164c8a31510aeb9d79129c

Comment 1 Pedro Sampaio 2022-01-11 14:22:42 UTC
Created virglrenderer tracking bugs for this issue:

Affects: epel-8 [bug 2039343]
Affects: fedora-all [bug 2039342]

Comment 2 Mauro Matteo Cascella 2022-01-31 11:43:25 UTC
Upstream MR:
https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/654