Lucene search

K
xenXen ProjectXSA-451
HistoryFeb 27, 2024 - 10:38 a.m.

x86: shadow stack vs exceptions from emulation stubs

2024-02-2710:38:00
Xen Project
xenbits.xen.org
13
control-flow enforcement technology
shadow stacks
return oriented programming
emulation
exceptions
hypervisor
denial of service
vulnerable systems
hvm guests
pvh guests

AI Score

7

Confidence

High

EPSS

0

Percentile

9.0%

ISSUE DESCRIPTION

Recent x86 CPUs offer functionality named Control-flow Enforcement Technology (CET). A sub-feature of this are Shadow Stacks (CET-SS). CET-SS is a hardware feature designed to protect against Return Oriented Programming attacks. When enabled, traditional stacks holding both data and return addresses are accompanied by so called “shadow stacks”, holding little more than return addresses. Shadow stacks aren’t writable by normal instructions, and upon function returns their contents are used to check for possible manipulation of a return address coming from the traditional stack.
In particular certain memory accesses need intercepting by Xen. In various cases the necessary emulation involves kind of replaying of the instruction. Such replaying typically involves filling and then invoking of a stub. Such a replayed instruction may raise an exceptions, which is expected and dealt with accordingly.
Unfortunately the interaction of both of the above wasn’t right: Recovery involves removal of a call frame from the (traditional) stack. The counterpart of this operation for the shadow stack was missing.

IMPACT

An unprivileged guest can cause a hypervisor crash, causing a Denial of Service (DoS) of the entire host.

VULNERABLE SYSTEMS

Xen 4.14 and onwards are vulnerable. Xen 4.13 and older are not vulnerable.
Only x86 systems with CET-SS enabled are vulnerable. x86 systems with CET-SS unavailable or disabled are not vulnerable. Arm systems are not vulnerable. See <a href=“https://xenbits.xen.org/docs/latest/faq.html#tell-if-cet-is-active”>https://xenbits.xen.org/docs/latest/faq.html#tell-if-cet-is-active</a> for how to determine whether CET-SS is active.
Only HVM or PVH guests can leverage the vulnerability. PV guests cannot leverage the vulnerability.