Bug 2058395 (CVE-2022-0854)

Summary: CVE-2022-0854 kernel: swiotlb information leak with DMA_FROM_DEVICE
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acaringi, adscvr, airlied, alciregi, allarkin, bdettelb, bhu, bskeggs, carnil, chwhite, crwood, dhoward, dvlasenk, fhrbata, hdegoede, hkrzesin, jarod, jarodwilson, jburrell, jeremy, jfaracco, jforbes, jglisse, jlelli, joe.lawrence, jonathan, josef, jshortt, jstancek, jwboyer, jwyatt, kcarcia, kernel-maint, kernel-mgr, kyoshida, lgoncalv, linville, lzampier, masami256, mchehab, nmurray, ptalbert, qzhao, rvrbovsk, scweaver, security-response-team, steved, vkumar, walters, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Linux kernel 5.17-rc8 Doc Type: If docs needed, set a value
Doc Text:
A memory leak flaw was found in the Linux kernel’s DMA subsystem, in the way a user calls DMA_FROM_DEVICE. This flaw allows a local user to read random memory from the kernel space.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-05 11:33:23 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: 2059701, 2059702, 2059703, 2059704, 2066077    
Bug Blocks: 2058396    

Description Pedro Sampaio 2022-02-24 19:23:23 UTC
A flaw was found in the Linux kernel. Information leak may occur through swiotlb.

Comment 6 Alex 2022-03-20 14:28:42 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2066077]

Comment 9 Salvatore Bonaccorso 2022-03-21 13:42:35 UTC
Can you confirm that this CVE is meant for the issues fixed by ddbd89deb7d3 ("swiotlb: fix info leak with DMA_FROM_DEVICE") in 5.17-rc6 and the required followup aa6f8dcbab47 ("swiotlb: rework "fix info leak with DMA_FROM_DEVICE"") in 5.17-rc8?

Comment 10 Alex 2022-03-22 10:37:22 UTC
In reply to comment #9:
> Can you confirm that this CVE is meant for the issues fixed by ddbd89deb7d3
> ("swiotlb: fix info leak with DMA_FROM_DEVICE") in 5.17-rc6 and the required
> followup aa6f8dcbab47 ("swiotlb: rework "fix info leak with
> DMA_FROM_DEVICE"") in 5.17-rc8?

Yes, I think that the patch for this one is
aa6f8dcbab47 "swiotlb: rework "fix info leak with DMA_FROM_DEVICE"".

The way to apply it described:
https://lore.kernel.org/all/YiIiHD7uA1o7Sj1X@kroah.com/t/
, so "IMHO the cleanest way to do this is a reverting the incorrect version of the patch and applying the correct one",
where
"Revert "swiotlb: fix info leak with DMA_FROM_DEVICE"
  swiotlb: fix info leak with DMA_FROM_DEVICE

 Documentation/core-api/dma-attributes.rst |  8 --------
 include/linux/dma-mapping.h               |  8 --------
 kernel/dma/swiotlb.c                      | 23 +++++++++++++++--------
 3 files changed, 15 insertions(+), 24 deletions(-)
"

and then apply
aa6f8dcbab47 "swiotlb: rework "fix info leak with DMA_FROM_DEVICE"".


Looking to the noted ddbd89deb7d3 that is noted inside aa6f8dcbab47 as "Fixes:"
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.17&id=aa6f8dcbab473f3a3c7454b74caa46d36cdc5d13
, this one aa6f8dcbab47 is the same at least if looking to the line
"kernel/dma/swiotlb.c                      | 23 +++++++++++++++--------",
means the same like revert described here https://lore.kernel.org/all/YiIiHD7uA1o7Sj1X@kroah.com/t/
, so yes actually ddbd89deb7d3 does incorrect fix and then can apply aa6f8dcbab47 that does both revert and correct fix.

If you get any more info during applying patches, please let us know here. Thank you.

Comment 11 Justin M. Forbes 2022-03-23 14:17:36 UTC
Yhis was fixed for Fedora with the 5.16.15 stable kernel updates.

Comment 15 errata-xmlrpc 2022-11-08 09:09:37 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:7444 https://access.redhat.com/errata/RHSA-2022:7444

Comment 16 errata-xmlrpc 2022-11-08 10:08:46 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:7683 https://access.redhat.com/errata/RHSA-2022:7683

Comment 17 errata-xmlrpc 2022-11-15 09:44:34 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2022:7933 https://access.redhat.com/errata/RHSA-2022:7933

Comment 18 errata-xmlrpc 2022-11-15 10:47:08 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2022:8267 https://access.redhat.com/errata/RHSA-2022:8267

Comment 19 Product Security DevOps Team 2022-12-05 11:33:18 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-0854

Comment 22 errata-xmlrpc 2024-01-24 16:42:18 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.6 Extended Update Support

Via RHSA-2024:0412 https://access.redhat.com/errata/RHSA-2024:0412