If the vmwgfx driver fails to copy the 'fence_rep' object to userland, it tries to recover by deallocating the (already populated) file descriptor. This is wrong, as the fd gets released via put_unused_fd() which shouldn't be used, as the fd table slot was already populated via the previous call to fd_install(). This leaves userland with a valid fd table entry pointing to a free'd 'file' object. We use this bug to overwrite a SUID binary with our payload and gain root. Linux kernel 4.14 - 5.16.x are vulnerable. Successfully tested against Ubuntu 22.04.01 with kernel 5.13.12-051312-generic.
Exploit database
Vulnerability
CVE-2022-22942
Vulnerability details
- Score
- 7.8
- Severity
- high
CVSS 3.1 · vmware
Vector string
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HDescription
The vmwgfx driver contains a local privilege escalation vulnerability that allows unprivileged users to gain access to files opened by other processes on the system through a dangling 'file' pointer.
CVE ProgramShowing saved CVE details. Refresh is temporarily unavailable.
Exploit source choices
1 sourcevmwgfx Driver File Descriptor Handling Priv Esc
2022-01-28vmwgfx_fd_priv_esc.rb