Live data from Hacker News

VMScape and why Xen dodged it

virtualize.sh

31–40 of 40 posts

Re: VMScape and why Xen dodged it

#31

If anyone was looking there are still some Xen VPS providers around, one of the oldest being Tornado VPS (formerly prgmr.com). https://tornadovps.com/about The founders literally wrote the book on xen: https://nostarch.com/releases/xen.html

This made me curious to find out reasons why KVM is so much more popular than Xen. I wasn't able to find anything concrete beyond "KVM is the standard and supported by out tooling", which obviously is the case nowadays, but still leaves me wondering what KVM did so much better than Xen when it first released or if this was just a concidence.

The Citrix fuckery triggered the development of XCP-ng. I've been using the XCP-ng/Xen Orchestra stack for several years now, both in my homelab and professionally. It is so much easier to work with than KVM that it's part of my go-to toolkit.

If you have a spare machine or feel like picking up a tiny form factor i5 PC, you can play with Zen and Xen Orchestra fairly easily.

I once ran a three-node cluster of TinyFormFactor PCs running Xen, and it was A good framework for learning. The only reason I moved away from it is that the TFF PCs only had one gigabit Ethernet port and were limited to 32GB of RAM. I moved to more traditional small desktop PCs so I could add multiple 10-gigabit Ethernet interfaces and RAM.

Someday, I'll write up how I did an easy DMZ with XCP-ng.

Re: VMScape and why Xen dodged it

#32

Earlier quoted context omitted.

This made me curious to find out reasons why KVM is so much more popular than Xen. I wasn't able to find anything concrete beyond "KVM is the standard and supported by out tooling", which obviously is the case nowadays, but still leaves me wondering what KVM did so much better than Xen when it first released or if this was just a concidence.

The Citrix fuckery triggered the development of XCP-ng. I've been using the XCP-ng/Xen Orchestra stack for several years now, both in my homelab and professionally. It is so much easier to work with than KVM that it's part of my go-to toolkit. If you have a spare machine or feel like picking up a tiny form factor i5 PC, you can play with Zen and Xen Orchestra fairly easily. I once ran a three-node cluster of TinyForm…

I use and like XCP-ng in my homelab, but the initial release was apparently in 2018. That's still ~15 years of Citrix fuckery that apparently birthed KVM.

Re: VMScape and why Xen dodged it

#33

Earlier quoted context omitted.

The Citrix fuckery triggered the development of XCP-ng. I've been using the XCP-ng/Xen Orchestra stack for several years now, both in my homelab and professionally. It is so much easier to work with than KVM that it's part of my go-to toolkit. If you have a spare machine or feel like picking up a tiny form factor i5 PC, you can play with Zen and Xen Orchestra fairly easily. I once ran a three-node cluster of TinyForm…

I use and like XCP-ng in my homelab, but the initial release was apparently in 2018. That's still ~15 years of Citrix fuckery that apparently birthed KVM.

Yeah, Citrix really made a mess of things. If you look at the history of IT companies, it's impressive how many user/company decisions are made because of vendor fuckery.

Re: VMScape and why Xen dodged it

#34
post #7

Earlier quoted context omitted.

It's not the em dash, but the negative parallelism ("not X, but Y"). This is a pattern which some LLMs really like using. I've seen some LLM-generated texts which used it in literally every sentence. (The irony of opening with this pattern is not lost on me.) As an aside, Wikipedia has a fascinating document identifying common "tells" for LLM-generated content: https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writ…

I'm also on the spectrum and like using various kinds of parallel construction, including antithesis. I also tend to use a lot of em dashes. If I posted something I wrote in, say, 2010, I'd likely get a lot of comments about my writing absolutely, 100% being AI-written. I have posted old writing snippets in the past year and gotten this exact reaction. I originally (two decades ago) started using em dashes, I think,…

I've started deliberately using em-dashes and “smart” quotes (made easy by configuring a compose key) — mostly because they look nice, but also out of spite for any software that's somehow not properly Unicode-aware in 20-fucking-25.

Re: VMScape and why Xen dodged it

#35
Author of the VMScape paper here.

It's great to see an article highlighting the impact of VMScape on Xen, especially since our paper [1] does not discuss Xen in detail (we only briefly mention it in the blog post [2]).

That said, the article unfortunately lacks technical precision. Some statements are vague, and "our quote" ("According to the ETH team") is misleading, as those are not our words. To be clear: VMScape is not a cross-VM attack. So please treat such summaries with caution.

Here are some clarifications:

The core issue lies in the hardware. On all AMD Zen CPUs, the branch prediction unit cannot natively distinguish between host user, guest-1 user, and guest-2 user domains (newer Intel CPUs can do to some extend). Supervisor domains (host or guest kernel) are protected by the CPU effectively disabling speculative execution in those domains. But because user domains share branch predictor state, execution in one can control speculation in another - the fundamental root of Spectre-BTI. To enforce isolation, predictors must be flushed (IBPB) whenever transitioning between such domains.

On Linux KVM, an IBPB is issued on guest-1 to guest-2 switches and on process switches. However, because a guest runs in the same process as its userspace hypervisor (e.g. QEMU, firecracker, etc), there is no isolation mechanism in place for this transition. VMScape exploits exactly this gap. The mitigation is to add an IBPB on guest to host userspace transitions.

Xen, while also running on the same flawed hardware, is not vulnerable to VMScape. But the reason is not (just) asynchronism. Asynchronism makes exploitation only harder. Instead, the key reason is that the equivalent of Linux's userspace hypervisor runs inside Dom0 on Xen, which is itself "treated like a guest". Because Xen already issues IBPBs between guest transitions, Dom0 is protected from DomU.

Assigning responsibility for vulnerabilities at the hardware–software boundary is inherently challenging and often depends on implicit assumptions about the threat model. VMScape introduces a novel threat model that had not been considered before. Consequently, the responsible entities concluded that the lack of host/guest branch predictor state isolation does not qualify as a hardware issue, since adequate mitigations, such as IBPB, are readily available, but insufficiently used by software.

[1] https://comsec-files.ethz.ch/papers/vmscape_sp26.pdf [2] https://comsec.ethz.ch/research/microarch/vmscape-exposing-a...

Re: VMScape and why Xen dodged it

#36

So this requires the two VMs to be sharing execution on a core? Or perhaps a shared cache? Or would it work across VMs "pinned" to different CPUs? It's weird to me that cloud hosts aren't absolutely swimming in cores now, but with Intel struggling and AMD somewhat resting on its laurels, which it stupidly did in the Hector Ruiz days, nothing is pushing the envelope. In 2010, fifteen years ago, we had 12 core CPUs. In…

Indeed, victim (e.g. userspace hypervisor like QEMU, firecracker, etc) and attacker (e.g. malicious guest) need to run on the same core. But with VMScape this is always give, because a guest runs as the same process as its hypervisor. Before VMScape, developers only isolated different VMs, different processes and supervisor domains from malicious users. VMScape explits a novel threat model.

Re: VMScape and why Xen dodged it

#37

I guess I don't quite follow. The attack can let an attacker in a normal VM see memory in either the host or a Xen dom0 VM. Why is it less impactful to get memory from the management VM instead of the host?

VMScape does not allow an attacker to read memory of Dom0 or the host. Dom0 is safe because branch predictor state is flushed when transitioning to Dom0, and the host is secured as it runs as supervisor, while VMScape only targets userspace. See my comment further up for more information.

Re: VMScape and why Xen dodged it

#38
post #5

While it’s interesting that Dom0 avoids Spectre-style branch prediction attacks it’s not clear from TFA exactly why that is so. How does the architecture of the hypervisor avoid an attack that seems to be at the hardware level? From my limited understanding of Spectre and Meltdown, swapping from a monolithic to a microkernel wouldn’t mitigate an attack. The mitigations discussed in the VMscape paper [0] are hardware…

Please see my other comment where I share more details about VMScape and why Xen is not affected. In short, it is because branch predictor state is flushed when transitioning to Dom0. Indeed, it has nothing to do with type of kernel... And yes, LLMs were at work. The "quote" in the article is not an actual quote...

Re: VMScape and why Xen dodged it

#39

I don’t quite see what they’re getting at. Is it just because it’s another VM switch to get to dom0? Seems a bit unlikely… Xen has a hypervisor for dealing with the low level details of virtualization and uses dom0 for management and some HW emulation. QEMU/KVM uses the host kernel for the low level details of virtualization and the QEMU userspace portion to do the actual HW emulation. They’re actually remarkably sim…

Yes, Xen is indeed protected thanks to using Dom0 for running the pendant of Linux's userspace hypervisor (QEMU, fircracker, etc.).This is because transitions to Dom0 lead to a branch predictor flush. See my other comment for more information. As you say, firecracker is equally affected by VMScape as QEMU is...

Re: VMScape and why Xen dodged it

#40
post #37

I guess I don't quite follow. The attack can let an attacker in a normal VM see memory in either the host or a Xen dom0 VM. Why is it less impactful to get memory from the management VM instead of the host?

VMScape does not allow an attacker to read memory of Dom0 or the host. Dom0 is safe because branch predictor state is flushed when transitioning to Dom0, and the host is secured as it runs as supervisor, while VMScape only targets userspace. See my comment further up for more information.

Since the attack does work cross-VM with KVM, it would then seem that Xen really has two advantages, and it kinda only got out unscathed because of the combination of both:

* management stuff mostly lives in Dom0

* Xen does the flushes to protect VMs from each other

If you didn't do the first, then attacks on the host might work, and if you didn't do the second then attacks on Dom0 might work, but the combination blocks both vectors. Is that about right?

Post reply on HN