Bug 2002627 (CVE-2021-3782)

Summary: CVE-2021-3782 wayland: libwayland-server wl_shm reference-count overflow
Product: [Other] Security Response Reporter: Dhananjay Arunesh <darunesh>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: ajax, ofourdan, sbarcomb, security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: wayland 1.20.91 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 18:32:38 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: 2122577, 2122578, 2122579, 2122580    
Bug Blocks: 2002623, 2003999    

Description Dhananjay Arunesh 2021-09-09 11:46:36 UTC
An internal reference count is held on the buffer pool, incremented every time a new buffer is created from the pool. The reference count is maintained as an int; on LP64 systems this can cause the reference count to overflow if the client creates a large number of wl_shm buffer objects, or if it can coerce the server to create a large number of external references to the buffer storage. With the reference count overflowing, a use-after-free can be constructed on the wl_shm_pool tracking structure, where values may be incremented or decremented; it may also be possible to construct a limited oracle to leak 4 bytes of server-side memory to the attacking client at a time.

Comment 2 Huzaifa S. Sidhpurwala 2022-08-30 10:33:48 UTC
Upstream bug: https://gitlab.freedesktop.org/wayland/wayland/-/issues/224

Comment 3 Huzaifa S. Sidhpurwala 2022-08-30 10:36:43 UTC
Created wayland tracking bugs for this issue:

Affects: fedora-all [bug 2122577]

Comment 5 errata-xmlrpc 2023-05-16 08:12:32 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2023:2786 https://access.redhat.com/errata/RHSA-2023:2786

Comment 6 Product Security DevOps Team 2023-05-16 18:32:36 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-2021-3782