Bug 2103900 (CVE-2022-2308)

Summary: CVE-2022-2308 kernel: use of uninitialized memory could lead to data leak in Virtio drivers with VDUSE
Product: [Other] Security Response Reporter: Mauro Matteo Cascella <mcascell>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acaringi, adscvr, airlied, alciregi, bhu, brdeoliv, bskeggs, carnil, chwhite, crwood, ddepaula, debarbos, dhoward, dvlasenk, fhrbata, hdegoede, hkrzesin, hpa, jarod, jarodwilson, jburrell, jfaracco, jferlan, jforbes, jglisse, jlelli, joe.lawrence, jonathan, josef, jshortt, jstancek, jwboyer, jwyatt, kcarcia, kernel-maint, kernel-mgr, lgoncalv, linville, lleshchi, lzampier, masami256, mchehab, nmurray, ptalbert, qzhao, rvrbovsk, scweaver, security-response-team, steved, tyberry, vkumar, walters, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel 6.0-rc5 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the Linux kernel in vDPA with VDUSE backend. There were no checks in VDUSE kernel driver to ensure the size of the device config space was in line with the features advertised by the VDUSE userspace application. In case of a mismatch, Virtio drivers config read helpers did not initialize the memory indirectly passed to vduse_vdpa_get_config() returning uninitialized memory from the stack. Such memory was not directly propagated to userspace, although under some circumstances it could be printed in the kernel logs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-25 12:15:25 UTC 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: 2126109    
Bug Blocks: 2090753    

Description Mauro Matteo Cascella 2022-07-05 08:35:24 UTC
A flaw was found in vDPA with VDUSE backend. There are currently no checks in VDUSE kernel driver to ensure the size of the device config space is in line with the features advertised by the VDUSE userspace application. In case of a mismatch, Virtio drivers config read helpers do not initialize the memory indirectly passed to vduse_vdpa_get_config() returning uninitialized memory from the stack. This could cause undefined behavior or data leaks in Virtio drivers.

Comment 3 Salvatore Bonaccorso 2022-08-20 07:05:03 UTC
Is there more information available on this issue? Is it known and fixed in upstream?

Comment 4 Mauro Matteo Cascella 2022-08-22 08:52:19 UTC
In reply to comment #3:
> Is there more information available on this issue? Is it known and fixed in
> upstream?

Not yet, a patch is going to be posted upstream soon. Thanks.

Comment 5 Mauro Matteo Cascella 2022-09-12 12:53:47 UTC
In reply to comment #4:
> Not yet, a patch is going to be posted upstream soon. Thanks.

https://lore.kernel.org/lkml/20220831154923.97809-1-maxime.coquelin@redhat.com/T/

To the best of our knowledge, the kernel stack is not directly propagated to userspace but in the worst case scenario (capacity field in Virtio-blk, which can be displayed in set_capacity_and_notify) it could be printed in the kernel logs.

Comment 6 Mauro Matteo Cascella 2022-09-12 13:18:40 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2126109]

Comment 8 Justin M. Forbes 2022-11-08 15:34:26 UTC
This was fixed for Fedora with the 5.19.14 stable kernel updates.

Comment 9 Product Security DevOps Team 2022-11-25 12:15:22 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2022-2308