# Deadlock in x86 HVM standard VGA handling

Xen x86 HVM standard VGA acceleration holds a lock past function return; emulating a two-memory-access instruction touching VGA MMIO re-acquires it, deadlocking the hypervisor and DoS-ing all domains.

- Payout: $2,162
- Severity: medium
- Program: Internet Bug Bounty
- Found by (vendor credit): Manuel Andreas of Technical University of Munich
- Found by: stonksy
- Disclosed: 2025-03-07
- CVE: CVE-2024-45818
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/2921724
- Library page: https://bugbountylibrary.com/r/h1%3A2921724
- Tags: area:cloud domain:infra impact:dos kind:bounty platform:hackerone sev:medium tech:linux technique:incomplete-fix technique:source-review vuln:dos vuln:misconfiguration vuln:race-condition

**Target:** Xen hypervisor x86 HVM standard VGA memory access emulation
**Root cause:** VGA acceleration code leaves a lock held after the acquiring function returns; a second VGA-memory access during emulation of a two-memory-access instruction attempts to re-acquire the already-held lock, deadlocking.
**Steps:**
1. Run an unprivileged x86 HVM DomU with virtual VGA in standard mode.
2. From ring0 in the guest, execute an instruction with two memory accesses both touching VGA memory (e.g. MMIO region).
3. Emulation of the 2nd access re-acquires the lock held from the 1st, deadlocking the hypervisor.
4. Observe host hypervisor hang and DoS of all other domains.
**How found:** Prior deadlock was found when the feature was introduced but analyzed incorrectly and the fix was incomplete; re-analysis of the unusual locking discipline (lock held past function return) revealed the re-acquisition path during two-access instruction emulation.
**Exploitation:** Attacker with ring0 code execution in an unprivileged x86-HVM DomU issues a crafted instruction whose two memory operands both hit VGA MMIO, triggering lock re-acquisition and hypervisor-wide deadlock.
**Insight:** Locks held past a function's return create re-entrancy hazards when the same resource is touched twice within one emulated operation; audit lock lifetime across emulation of multi-access instructions, and check whether 'disabled' features still take locks on the MMIO path.

