Bug 2071 - There is an out-of-bounds write vulnerability in vmwgfx driver
Summary: There is an out-of-bounds write vulnerability in vmwgfx driver
Status: NEW
Alias: None
Product: Anolis OS 8
Classification: Anolis OS
Component: kernel - anck-5.10 (show other bugs) kernel - anck-5.10
Version: 8.6
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: xiangzao
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-06 14:11 UTC by Ezrak1e
Modified: 2023-01-11 14:23 UTC (History)
4 users (show)

See Also:


Attachments
poc (deleted)
2022-09-06 14:11 UTC, Ezrak1e
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ezrak1e 2022-09-06 14:11:17 UTC
Description of problem:

There is an out-of-bounds write vulnerability in vmwgfx driver
Linux VMware guests have the device file /dev/dri/renderD128 (or Dxxx) which can be used to send ioctl()s to VMWare graphics driver, [vmwgfx] module. On some distributions this device is readable and writable by unprivileged users
Vulnerability location:
Drivers/gpu/vmxgfx/vmxgfx_kms.c
vmw_kms_cursor_snoo

Vulnerable code:
memcpy(srf->snooper.image + i * 64,
                   virtual + i * cmd->dma.guest.pitch,
                   box->w * 4);
The length of the copy is not checked, which can cause out-of-bounds writes

Version-Release number of selected component (if applicable):
5.13.0-53


How reproducible:
In the linux environment of vmware, compile the poc file and execute
Steps to Reproduce:
gcc poc.c -o poc
./poc

Actual results:
DOS

Expected results:
DOS

=*=*=*=*=*=*=*=*=  Credit  =*=*=*=*=*=*=*=*=
ziming zhang(@ezrak1e) from Ant Group Light-Year Security Lab

Best Regards,
ziming
Comment 1 Ezrak1e 2022-09-06 14:11:41 UTC
Created attachment 386 [details]
poc
Comment 2 Shiloong admin 2022-09-27 09:57:45 UTC
The content of attachment 386 [details] has been deleted
Comment 3 sbeattie 2023-01-11 14:23:49 UTC
Hi, this issue was assigned CVE-2022-36280 (I'm not the assigner, just a messenger). It appears to have been addressed in upstream commit 4cf949c7fafe ("drm/vmwgfx: Validate the box size for the snooped cursor") (v6.2-rc1). ziming, can you confirm this is the case?

Thanks!