Skip to content
DoS Disclosed report Advanced CVE-2024-45818

Deadlock in x86 HVM standard VGA handling

The hypervisor's VGA acceleration code holds a lock across function returns, so emulating an instruction with two VGA memory accesses causes a re-acquisition deadlock. An attacker with ring0 code in an unprivileged x86 HVM guest can trigger this deadlock, causing a denial of service for all domains and the hypervisor.

stonksy Follow

Originally disclosed on HackerOne

Bounty$2,162 Medium 5.5 View original
  • Fixed in 33 days
  • Paid in 33 days
  • Disclosed after 2 months

Summary by the program

ISSUE DESCRIPTION

The hypervisor contains code to accelerate VGA memory accesses for HVM guests, when the (virtual) VGA is in "standard" mode. Locking involved there has an unusual discipline, leaving a lock acquired past the return from the function that acquired it. This behavior results in a problem when emulating an instruction with two memory accesses, both of which touch VGA memory (plus some further constraints which aren't relevant here). When emulating the 2nd access, the lock that is already being held would be attempted to be re-acquired, resulting in a deadlock.

This deadlock was already found when the code was first introduced, but was analysed incorrectly and the fix was incomplete. Analysis in light of the new finding cannot find a way to make the existing locking discipline work.

In staging, this logic has all been removed because it was discovered to be accidentally disabled since Xen 4.7. Therefore, we are fixing the locking problem by backporting the removal of most of the feature. Note that even with the feature disabled, the lock would still be acquired for any accesses to the VGA MMIO region.

Advisory: https://xenbits.xen.org/xsa/advisory-463.txt

The report

Overview

This vulnerability has been reported to the Xen project maintainers in mid October 2024. The Xen project has acknowledged the vulnerability, published patches and released an advisory as well as a CVE, see: https://xenbits.xen.org/xsa/advisory-463.html

Vulnerability

The hypervisor contains code to accelerate VGA memory accesses for HVM guests, when the (virtual) VGA is in "standard" mode. Locking involved there has an unusual discipline, leaving a lock acquired past the return from the function that acquired it. This behavior results in a problem when emulating an instruction with two memory accesses, both of which touch VGA memory (plus some further constraints which aren't relevant here). When emulating the 2nd access, the lock that is already being held would be attempted to be re-acquired, resulting in a deadlock. This deadlock was already found when the code was first introduced, but was analysed incorrectly and the fix was incomplete. Analysis in light of the new finding cannot find a way to make the existing locking discipline work. In staging, this logic has all been removed because it was discovered to be accidentally disabled since Xen 4.7. Therefore, we are fixing the locking problem by backporting the removal of most of the feature. Note that even with the feature disabled, the lock would still be acquired for any accesses to the VGA MMIO region.

Attached is the PoC that I utilized for the original report of the vulnerability to the Xen maintainers. It was tested on Xen version 4.19.

Impact

An attacker executing code in ring0 inside of an unprivileged x86-HVM-DomU can trigger a deadlock in the host hypervisor, resulting in a Denial of Service of all other Domains running under the Hypervisor, including the hypervisor itself. "Xen versions 4.6 through 4.19 are vulnerable." as per the referenced XSA. The CVE database (https://nvd.nist.gov/vuln/detail/CVE-2024-45818) contains a CVSS v3.x rating of: 6.5 Medium.

The original report as published on HackerOne, by stonksy. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

Xen is a type-1 hypervisor. Guests of the HVM kind run fully virtualised hardware, and among the emulated devices they see is a standard VGA adapter. To keep VGA memory accesses from HVM guests reasonably fast, the hypervisor contains code that accelerates those accesses when the (virtual) VGA is in "standard" mode, rather than trapping and emulating every single one.

The bug described here lives in that acceleration path. It is not a memory-safety flaw and not an information leak: it is a locking defect that lets a guest stall the hypervisor. The report was filed against the Xen Project repositories under the Internet Bug Bounty program, rated medium with a CVSS of 5.5, and paid a bounty of 2162.00 USD. The weakness class recorded is Improper Input Validation. It was disclosed on 2025-03-07.

The Xen project published an advisory and a CVE for it:

Setup

The researcher reported the issue to the Xen project maintainers in mid October 2024. The Xen project acknowledged it, published patches, and released both the advisory and the CVE.

The proof of concept was tested on Xen version 4.19. The attacker's position is code execution in ring 0 inside an unprivileged x86 HVM DomU. That is the precondition that matters: the guest must already be able to run kernel-level code in its own domain, which is the normal state of a guest kernel and therefore a low bar for a malicious or compromised guest.

Finding it

The acceleration code uses an unusual locking discipline: it leaves a lock acquired past the return from the function that acquired it. That is the detail that looked wrong. A lock whose lifetime does not match the function that took it is fragile by construction, because every caller has to know that it is now holding something it did not ask for.

The failure mode follows directly from that discipline. When the hypervisor emulates an instruction that performs two memory accesses and both of them touch VGA memory (subject to some further constraints which the report does not detail), the emulation of the second access tries to re-acquire the lock that is already held. The result is a deadlock.

This was not a new discovery in the sense of never having been seen. The deadlock was already found when the code was first introduced, but it was analysed incorrectly and the fix was incomplete. The researcher's analysis in light of the new finding could not find a way to make the existing locking discipline work at all.

Exploitation

Step 1: run kernel code in an unprivileged HVM guest

The attacker executes code in ring 0 inside an unprivileged x86 HVM DomU.

Step 2: trigger two VGA memory accesses in one emulated instruction

When an instruction with two memory accesses is emulated and both accesses touch VGA memory, the first access takes the lock and, under the unusual discipline, returns with the lock still held. Emulating the second access attempts to re-acquire that same lock. The hypervisor deadlocks.

Step 3: observe the denial of service

The deadlock is in the host hypervisor, so it affects every other domain running under that hypervisor, including the hypervisor itself.

The report states that a PoC was attached to the original report sent to the Xen maintainers, tested on Xen 4.19. The text of the PoC is not reproduced in the report itself.

Root cause

The root cause is the locking discipline in the VGA acceleration code: a lock is acquired inside a function and deliberately left held after that function returns. Any path that re-enters the same code while the lock is held will self-deadlock, and emulating an instruction with two VGA memory accesses is exactly such a path.

The reason existing defences did not stop it is historical. The deadlock had been found when the feature was introduced, but the earlier analysis was wrong and the fix was incomplete, so the underlying discipline was never corrected. The researcher could not find a way to make that discipline work.

There is a further wrinkle worth noting. In staging, the acceleration logic had already been removed, because it was discovered to have been accidentally disabled since Xen 4.7. So the vulnerable code was, in practice, not doing its job for a long time.

Impact

An attacker executing code in ring 0 inside an unprivileged x86 HVM DomU can trigger a deadlock in the host hypervisor. The consequence is a denial of service affecting all other domains running under the hypervisor, including the hypervisor itself.

According to the referenced XSA, Xen versions 4.6 through 4.19 are vulnerable. The CVE database entry gives a CVSS v3.x rating of 6.5 Medium.

Fix

Because the acceleration logic had already been removed in staging (it had been accidentally disabled since Xen 4.7 anyway), the fix is to backport the removal of most of the feature, rather than to repair the locking discipline. The researcher's analysis could not find a way to make the existing discipline work, so removal was the chosen route.

One limit is stated explicitly: even with the feature disabled, the lock is still acquired for any accesses to the VGA MMIO region. The fix removes the acceleration path that produced the re-entrant acquisition, not the locking around the MMIO region itself.

Variants to test

  • Other emulated devices with deferred lock lifetimes. Look for emulation code where a lock is taken in a helper and intentionally left held after the helper returns. A positive result is a path where the same helper can be re-entered before the lock is released.
  • Instructions with two accesses to the same emulated region. The trigger here is an instruction whose emulation touches the accelerated region twice. Try other instruction forms that produce multiple accesses to the same MMIO or accelerated memory area and watch for a stall rather than a fault.
  • Features that were disabled by accident. The acceleration here had been accidentally disabled since Xen 4.7, which hid the bug. Check whether other acceleration or fast paths in a hypervisor are actually reachable in current builds; a path that looks dead may still be reachable under specific guest configurations.
  • Historical fixes that were incomplete. Where a deadlock or race was patched years ago, re-read the original analysis. A positive result is a fix that addresses the symptom on one path but leaves the underlying discipline in place.

Hunting notes

This kind of bug hides in fast paths and acceleration code: places where a hypervisor or kernel deliberately bends normal locking rules to keep a hot path cheap. The signal during recon is code that documents an unusual locking discipline, or a lock whose release point is in a different function from its acquisition. Comments explaining why a lock is held across a return are worth reading closely.

A second signal is history. If a deadlock or race in the same area was fixed before, check whether the fix was complete; here the earlier analysis was wrong and the fix incomplete, and the bug survived.

On impact: the researcher showed that the deadlock is reachable from ring 0 in an unprivileged HVM guest and that it takes down the hypervisor and every other domain on it, which is what makes a guest-triggerable stall a serious finding rather than a curiosity. The PoC was tested on Xen 4.19, and the XSA states that Xen versions 4.6 through 4.19 are vulnerable.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 14 min read.

What happened, in plain words

Imagine a large office building where every company rents a floor. The building has one shared lift, and the lift has a rule: whoever presses the button keeps the key until they are done. Now imagine a person who presses the button, walks away without returning the key, and later comes back and tries to press the button again. They are holding the key, so they cannot get it, and they wait forever. Nobody else can use the lift either. The whole building grinds to a halt because of one person.

That is roughly what this report describes, but inside a computer. The building is a hypervisor, a piece of software that runs several operating systems side by side on one physical machine. Each operating system is called a guest or a domain. The lift is a lock, a mechanism that stops two parts of a program from using the same thing at the same time. The person holding the key is a piece of code that takes the lock and then, unusually, does not give it back when it finishes its job. When the same code is asked to do a second job straight away, it tries to take the lock again, cannot, and waits forever. That permanent wait is called a deadlock.

The result is that one guest can freeze the entire hypervisor and every other guest running on it. This is a denial of service: the attacker does not steal data or break into anything, they simply stop the system from working.

The bug was found in Xen, a well-known hypervisor. It was reported to the Xen maintainers in mid October 2024, and they acknowledged it, wrote patches, and published an advisory and a CVE (a public catalogue entry for a security flaw). The report was filed under the Internet Bug Bounty program, rated medium with a CVSS score of 5.5, and paid a bounty of 2162.00 USD. The weakness class recorded is Improper Input Validation. It was disclosed on 2025-03-07.

Background: what Xen is and what it does

Xen is a type-1 hypervisor. That means it runs directly on the physical hardware, underneath all the operating systems, rather than being an application inside one of them. Think of it as the building manager who owns the building and rents out floors, as opposed to a tenant who sublets a room.

Guests come in different kinds. The kind relevant here is HVM, which stands for Hardware Virtual Machine. An HVM guest is given a fully simulated computer: it sees fake hardware that looks real to it, including a standard VGA adapter. VGA is the old, simple graphics standard that computers have used for decades to draw text and images on a screen. The guest thinks it has a real graphics card, but in fact the hypervisor is pretending.

Pretending is slow. Every time the guest tries to write to its fake graphics memory, the hypervisor has to step in, work out what the guest meant, and do it on the guest's behalf. This stepping in is called trapping and emulating. To avoid doing that for every single access, Xen contains special code that accelerates VGA memory accesses when the virtual VGA is in what is called "standard" mode. Acceleration here means: let the guest do the common case quickly instead of stopping it every time.

The bug lives in that acceleration code. It is important to be clear about what kind of bug it is not. It is not a memory-safety flaw (where a program reads or writes memory it should not, potentially letting an attacker run their own code). It is not an information leak (where secret data escapes). It is a locking defect: a mistake in how the program coordinates access to shared resources, which lets a guest stall the hypervisor.

The setup: who can trigger this, and how

The researcher reported the issue to the Xen project maintainers in mid October 2024. The Xen project acknowledged it, published patches, and released both the advisory and the CVE:

The proof of concept was tested on Xen version 4.19.

Now, the attacker's position. To trigger this bug, someone needs to be able to run code in ring 0 inside an unprivileged x86 HVM DomU. Let us unpack that.

  • Ring 0 is the most privileged level of an x86 processor. Processors have several privilege levels, like floors in a building with different access rights. Ring 0 is the level where the operating system kernel runs: it can do anything. Lower rings (ring 3, for example) are where ordinary applications run, with far fewer powers.
  • DomU is Xen's name for an unprivileged guest domain. "Unprivileged" means it is a normal tenant, not the special management domain (called Dom0) that controls the hypervisor.
  • x86 is the family of processors (made by Intel and others) that this applies to.

So the attacker needs to be running kernel-level code inside their own guest. Is that a high bar? No. Every guest operating system already runs its own kernel at ring 0 within its own domain. If an attacker controls a guest, or has compromised one, they already have that. The report states the precondition: code execution in ring 0 inside an unprivileged x86 HVM DomU.

Finding it: the unusual locking discipline

The acceleration code uses what the report calls an unusual locking discipline. A discipline, in programming, is a set of rules that everyone follows. The normal rule for a lock is simple: the function that takes the lock is the function that releases it, before it returns. Like borrowing a library book and returning it before you leave the building.

This code breaks that rule. It leaves a lock acquired past the return from the function that acquired it. In other words, a function takes the lock, does its work, and then hands control back to whoever called it, still holding the lock. The caller now holds something it never asked for and may not know about.

That is the detail that looked wrong to the researcher. A lock whose lifetime does not match the function that took it is fragile by construction, because every caller has to know that it is now holding something extra. If any caller forgets, or if the code is re-entered, things go wrong.

The failure mode follows directly. When the hypervisor emulates an instruction (pretends to execute it on the guest's behalf) that performs two memory accesses, and both of those accesses touch VGA memory, the following happens:

  1. The first access takes the lock.
  2. Under the unusual discipline, the function returns with the lock still held.
  3. The emulation moves on to the second access, which tries to take the same lock again.
  4. The lock is already held, so the second attempt waits.
  5. It waits forever, because the only thing that could release the lock is the very code that is now stuck waiting.

That is the deadlock. The report mentions "some further constraints which aren't relevant here", meaning there are extra conditions for the trigger that it does not spell out.

This was not a brand-new discovery in the sense of never having been seen. The deadlock was already found when the code was first introduced, but it was analysed incorrectly and the fix was incomplete. The researcher's fresh analysis could not find any way to make the existing locking discipline work at all.

Exploitation: step by step

Step 1: run kernel code in an unprivileged HVM guest

The attacker executes code in ring 0 inside an unprivileged x86 HVM DomU. From there, the guest issues the instruction pattern that reaches the VGA acceleration path. Why this step? Because the acceleration code only runs when a guest does something that touches its virtual graphics memory.

Step 2: trigger two VGA memory accesses in one emulated instruction

When an instruction with two memory accesses is emulated and both accesses touch VGA memory, the first access takes the lock and, under the unusual discipline, returns with the lock still held. Emulating the second access attempts to re-acquire that same lock. The hypervisor deadlocks. Why this step? Because the bug only fires when the same lock is needed twice by the same path.

Step 3: observe the denial of service

The deadlock is in the host hypervisor, so it affects every other domain running under that hypervisor, including the hypervisor itself. Why this matters? Because the hypervisor is the shared foundation for all guests. If it freezes, every tenant on the machine freezes with it. One guest can take down the whole building.

The report states that a PoC (proof of concept, a small program that demonstrates the bug) was attached to the original report sent to the Xen maintainers, tested on Xen 4.19. The text of the PoC is not reproduced in the report itself, so there is no code to show here.

Root cause: why it happened

The root cause is the locking discipline in the VGA acceleration code: a lock is acquired inside a function and deliberately left held after that function returns. Any path that re-enters the same code while the lock is held will self-deadlock, and emulating an instruction with two VGA memory accesses is exactly such a path.

Think of it like a shop with a single fitting room key. The assistant hands you the key, then walks off to help someone else without taking it back. If you then ask the same assistant for the key again, they cannot give it to you because you already have it, and you both stand there waiting. The rule was broken at the start, and every later step inherits the problem.

Why did existing defences not stop it? The reason is historical. The deadlock had been found when the feature was introduced, but the earlier analysis was wrong and the fix was incomplete, so the underlying discipline was never corrected. The researcher could not find a way to make that discipline work.

There is a further wrinkle. In staging (the development branch where new code is prepared before release), the acceleration logic had already been removed, because it was discovered to have been accidentally disabled since Xen 4.7. In other words, the vulnerable code was, in practice, not doing its job for a long time. The fast path was effectively switched off by accident.

Impact: what an attacker gains

An attacker executing code in ring 0 inside an unprivileged x86 HVM DomU can trigger a deadlock in the host hypervisor. The consequence is a denial of service affecting all other domains running under the hypervisor, including the hypervisor itself.

According to the referenced XSA (Xen Security Advisory, the project's official security notice), Xen versions 4.6 through 4.19 are vulnerable. The CVE database entry gives a CVSS v3.x rating of 6.5 Medium. CVSS is a standard scoring system for security flaws; 6.5 is in the medium band, reflecting that the bug stops systems working but does not let an attacker read or change data.

Fix: how it was resolved

Because the acceleration logic had already been removed in staging (it had been accidentally disabled since Xen 4.7 anyway), the fix is to backport the removal of most of the feature. Backporting means taking a change made in the development branch and applying it to older, supported versions. Rather than repairing the locking discipline, the maintainers removed the code that caused the problem. The researcher's analysis could not find a way to make the existing discipline work, so removal was the chosen route.

One limit is stated explicitly: even with the feature disabled, the lock is still acquired for any accesses to the VGA MMIO region. MMIO stands for memory-mapped input/output: a technique where hardware devices are controlled by reading and writing to special memory addresses, as if they were ordinary memory. The fix removes the acceleration path that produced the re-entrant acquisition, not the locking around the MMIO region itself.

Variants to test: where else to look

  • Other emulated devices with deferred lock lifetimes. Look for emulation code where a lock is taken in a helper function and intentionally left held after the helper returns. A positive result is a path where the same helper can be re-entered before the lock is released. In plain terms: find other places where the key is handed out and not taken back, then see if the same person can ask for it twice.
  • Instructions with two accesses to the same emulated region. The trigger here is an instruction whose emulation touches the accelerated region twice. Try other instruction forms that produce multiple accesses to the same MMIO or accelerated memory area and watch for a stall rather than a fault. A stall means the system simply stops responding; a fault means it reports an error. The interesting case is the silent freeze.
  • Features that were disabled by accident. The acceleration here had been accidentally disabled since Xen 4.7, which hid the bug. Check whether other acceleration or fast paths in a hypervisor are actually reachable in current builds. A path that looks dead may still be reachable under specific guest configurations. In everyday terms: a door that looks locked may still open if you push it the right way.
  • Historical fixes that were incomplete. Where a deadlock or race was patched years ago, re-read the original analysis. A positive result is a fix that addresses the symptom on one path but leaves the underlying discipline in place. A race, here, means two things happening at once in an order the programmer did not expect.

Hunting notes: how to spot this kind of bug

This kind of bug hides in fast paths and acceleration code: places where a hypervisor or kernel deliberately bends normal locking rules to keep a hot path cheap. A hot path is code that runs very often, so even a tiny saving matters. The signal during recon (reconnaissance, the early phase of looking around a system for weaknesses) is code that documents an unusual locking discipline, or a lock whose release point is in a different function from its acquisition. Comments explaining why a lock is held across a return are worth reading closely.

A second signal is history. If a deadlock or race in the same area was fixed before, check whether the fix was complete. Here the earlier analysis was wrong and the fix incomplete, and the bug survived.

On impact: the report states that the deadlock is reachable from ring 0 in an unprivileged HVM guest and that it affects the hypervisor and every other domain on it. That is what makes a guest-triggerable stall a serious finding rather than a curiosity. The report ties the behaviour to a concrete tested version (Xen 4.19) and to the affected version range in the advisory (4.6 through 4.19).

Glossary

  • Hypervisor: software that runs several operating systems side by side on one physical machine and shares the hardware between them.
  • Type-1 hypervisor: a hypervisor that runs directly on the hardware, underneath all the operating systems, rather than as an application inside one.
  • Guest / domain: an operating system running under a hypervisor. Xen calls them domains.
  • DomU: Xen's name for an unprivileged guest domain, as opposed to Dom0, the management domain.
  • HVM: Hardware Virtual Machine, a guest that is given fully simulated hardware and believes it has a real computer.
  • VGA: an old, simple graphics standard; a VGA adapter is the hardware that draws text and images on a screen.
  • Standard VGA mode: a basic graphics mode that the virtual VGA adapter can be in, which the acceleration code checks for.
  • Trap and emulate: when the hypervisor stops a guest's access to fake hardware, works out what the guest meant, and performs it on the guest's behalf.
  • Acceleration / fast path: special code that lets the common case run quickly instead of being stopped and emulated every time. A hot path is code that runs very often.
  • Lock: a mechanism that stops two parts of a program from using the same thing at the same time; whoever holds the lock has exclusive access.
  • Locking discipline: the set of rules about who takes a lock, when, and who releases it.
  • Deadlock: a permanent wait where each side is waiting for something the other side holds, so nothing ever proceeds.
  • Re-entrant / re-acquire: entering the same code again, or trying to take a lock that is already held.
  • Denial of service (DoS): an attack that stops a system from working, without necessarily stealing or changing data.
  • Memory-safety flaw: a bug where a program reads or writes memory it should not, potentially letting an attacker run their own code.
  • Information leak: a bug where secret data escapes to someone who should not see it.
  • Ring 0: the most privileged level of an x86 processor, where the operating system kernel runs.
  • x86: the family of processors (made by Intel and others) that this applies to.
  • Kernel: the core part of an operating system that controls hardware and runs at the highest privilege level.
  • Instruction: a single command that a processor executes.
  • Emulate: to pretend to execute something on another system's behalf, producing the same result.
  • MMIO: memory-mapped input/output, a technique where hardware devices are controlled by reading and writing to special memory addresses.
  • Staging: the development branch where new code is prepared before release.
  • Backport: taking a change made in a development branch and applying it to older, supported versions.
  • PoC (proof of concept): a small program that demonstrates a bug actually works.
  • CVE: a public catalogue entry that gives a security flaw a unique identifier.
  • XSA: Xen Security Advisory, the Xen project's official security notice.
  • CVSS: a standard scoring system for security flaws, from low to critical.
  • Bounty: a payment made to a researcher who reports a valid security flaw.
  • Recon (reconnaissance): the early phase of looking around a system for weaknesses.
  • Race: a bug where two things happen at once in an order the programmer did not expect.
  • Improper Input Validation: a weakness class where a program fails to check that the data it receives is sensible and safe.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.