Plug Your Volt: Protecting Intel Processors Against Dynamic Voltage Frequency Scaling Based Fault Attacks
Plug Your Volt: Protecting Intel Processors Against Dynamic Voltage Frequency Scaling Based Fault Attacks
1 Introduction
are responsible for putting the system in unsafe states where fault attacks oc-
cur. We then develop a countermeasure around this observation and enforce a
functional mapping between core frequency and core voltage, which forces the
system into always being in a safe state. Since our countermeasure allows the
processor core voltage to tread freely into safe states, it provides the required
flexibility to demanding applications to undervolt and overclock the cores while
protecting them from DVFS-styled fault attacks.
1.1 Contributions
To summarize, we make the following contributions in this work.
– We put forth a new countermeasure philosophy for DVFS by characterizing
a victim system into safe and unsafe states. Concretely, our countermea-
sure design attempts to use the fundamental causal property of DVFS fault
attacks to develop the countermeasure, rather than using auxiliary methods
like ○1 access control checks, and ○
2 deflection, unlike prior works. We first
root-cause DVFS attacks to note that modern system design allows causal
independence in controlling a core’s frequency and voltage, and use this to
define safe-unsafe system states with respect to system stability against
DVFS attacks.
– We develop a software-only countermeasure that resides as a kernel module
and uses our system characterization to prevent DVFS based fault attacks
from being mounted. By relying on our definition of safe-unsafe states,
we are able to base the countermeasure outside any SGX context, thereby
allowing our countermeasure to work within a more robust and practical
threat model than prior works [12, 15] (like not relying on third-party
mechanisms to assume absence of single/zero-stepping of SGX enclaves).
Our experiments show that our countermeasure is able to completely prevent
DVFS induced faults, while showing an acceptable overhead of 0.28%.
– Our characterization of safe-unsafe system states allows identification of
maximal safe state for a given system, allowing our countermeasure to be
potentially deployable as a ○
1 microcode assist, or ○
2 model-specific register
(MSR), by respective CPU vendors. As opposed to literature like [15] and
[12], our countermeasure also has the ability to be implemented at a more
fundamental level in the micro-architecture.
2 Background
In this section, we provide the necessary background on Intel SGX, DVFS, and
attack methodology by undervolting.
referred to as an enclave, where sensitive code and data can be protected from po-
tentially malicious software and even privileged system software. Therefore, even
if the kernel is compromised, the security of the programs and corresponding data
processed inside the enclaves are supposedly guaranteed by the hardware-based
isolation. This technology is particularly crucial in scenarios where confidential-
ity and integrity of computations are paramount.
Intel SGX logically partitions an application into a trusted and untrusted
part where the trusted part containing source codes for sensitive computations
runs inside the enclave and the untrusted part mostly consists of benign opera-
tions that do not involve secret information. The operating system initiates the
execution of the process by launching the unstrusted part, which in turn initi-
ates the trusted part inside enclave as per the program logic. SGX ensures that
the enclave’s execution state and memory are inaccessible to all other processes
in the system as well as the operating system. The threat model of SGX only
assumes the CPU to be trusted. Therefore, even in the presence of a compro-
mised kernel and superuser adversary, the hardware provides isolation guarantee
of enclaves.
In spite of such hardware-based isolation, a number of side channel attacks
have raised serious question on the security guarantees of Intel SGX. While the
enclave memory and execution states are protected, other important features
that interact with programs such as page table management, scheduling, inter-
rupt handling, etc. are managed by the OS. A number of attacks [20] have been
proposed in literature that undermine the security guarantees of SGX. Due to the
permissible threat model of SGX, adversary can manipulate critical OS features
like APIC timer interrupts to precisely control the execution flow of the processes
running inside the enclave. In addition, transient attacks like Foreshadow [26],
Zombieload [22], etc. leak information from enclaves.
Modern computing systems have different power and energy requirements which
vary across form factors and their usage. Specifically, mobile devices such as lap-
tops, tablets and smartphones require constant balancing between power con-
sumption and performance. The amount of energy consumed by the processor
in the integral of the instantaneous power over a certain period of time. The
instantaneous power consists of two components - dynamic and static power.
While the static power is independent of the operations being performed in the
system, the dynamic power is dependent on the switching activities of the dig-
ital circuits in the processor. More specifically, the dynamic power is directly
proportional to the clock frequency and voltage. In consequence, low frequency
and voltage help in reducing energy dissipation.
In most modern processors, Dynamic Frequency and Voltage Scaling (DVFS)
is employed to maintain a delicate balance between energy consumption and per-
formance. Linux-based operating systems provide a DVFS driver to dynamically
manage core frequencies and voltage using different interfaces that vary across
6 N. Mishra et al.
Table 1: Description of different bits of MSR 0x150. 0 indicates the least signif-
icant bit (LSB).
Bits Function Explanation
0 - 20 - Reserved
21 - 31 offset Voltage offset (in milli-volts) relative to base core voltage
32 write-enable Enable bit to allow read/write functionality
33 - 39 - Reserved
Domain whose voltage needs to be scaled
40 - 42 Plane select 0 = CPU core; 1 = GPU; 2 = cache
3 = uncore; 4 = analog I/O;
43 - 63 - Reversed
different processor vendors. The driver generally provides different scaling gover-
nors for different performance demands. The operational (allowable) frequency
of a processor is limited to a range of independent values, called frequency ta-
ble [9]. The range of permissible frequency values are set by the processor vendor
for optimal usage with flexibility for dynamic scaling without damaging it. The
OS provides interface for applications to configure frequencies through userspace
using suitable scaling governors. However, the operating voltage of the processors
is not allowed to be changed through these governors.
in the arrival of the clock signal to the flip-flops. From a circuit design per-
spective, the clock for F2 can arrive at any point in the closed time interval
[Tclk − Tϵ , Tclk + Tϵ ]. On a real circuit, these variations can arise from a variety
of sources like variations in the clock distribution network, spatial voltage and
cycle-to-cycle variations in the loop distribution network, and temporal/spatial
jitter. Since these variations are immeasurable and unavoidable, a circuit should
not be configured to deliver a stabilized output beyond a time upper-bounded by
(Tclk −Tϵ ). This is the worst case scenario when unavoidable variations cause the
clock to arrive earlier than expected. This leads us to make the first checkpoint
observation:
We now use the observations made in Sec. 3.1 about safe state of F1 to establish
the fundamental cause of DVFS based fault attack vectors. Concretely, a DVFS
fault attack is successful when it forces the sequential flip-flop F1 (c.f. Fig. 1)
into an unsafe state. We can define an unsafe state of F1 as:
core voltage, variations in core frequency impact Tclk , and thereby influence the
right-hand side of Eq. 2. Consequently, an adversary is able to independently
tweak core frequency as well as core voltage, causing inequality Eq. 3 to occur,
thereby sending the system into unsafe state and eventually mounting a suc-
cessful DVFS-based fault attack. It is worth mentioning that previous attacks
like [19, 14, 6] focus on one aspect from the voltage-frequency pair while keeping
the other constant.
In Sec. 3.2, we put forth a fresh perspective, missing from prior DVFS styled
attacks (as in [19, 14, 6]), that by allowing independent adversarial control over
frequency and voltage, modern systems have made themselves vulnerable. More
precisely, the independence of control over core frequency and core voltage al-
lows an adversary to find specific voltage-frequency pairs that force the system
into unsafe states. Interestingly, from a defender’s perspective, one can use this
inquisitive observation to develop a countermeasure philosophy, as stated below.
Limiting causal independence of voltage-frequency. Based on root-
causing DVFS (ref. Observation O3), our countermeasure philosophy relies
on limiting the independence with which core frequency and voltage can be
altered. This can be done by enforcing a relationship between allowed values of
core frequency and core voltage, thereby preventing the system from entering
into an unsafe state.
Concretely, by performing characterization of a system for safe-unsafe states,
our countermeasure philosophy proposes to identify core voltage and core fre-
quency relationships where the system enters unsafe state, and deploy counter-
measure mechanisms to prevent such unsafe states from occurring. In the next
section, we elaborate on the design of the countermeasure.
In this section, we describe how we use the observations from Sec. 3.3 to de-
velop and deploy a purely software-based countermeasure against DVFS-styled
attacks. The countermeasure design proceeds in two steps:
– S1. Empirically creating core frequency and core voltage pairs that cause a
system to enter into unsafe state.
– S2. Deploy a polling based mechanism on model-specific registers (MSRs)
to limit causal independence of core frequency and core voltage to prevent
the system from entering into unsafe states.
Before moving forward, we first establish the attacker threat model based on
the publicly available works that propose DVFS-based fault attacks.
Plug Your Volt 11
non-SGX processes even when SGX context is in execution, while still main-
taining SGX security. We note that adding such software/micro-architectural
optimization features into SGX attestation is a very normal security offering
(similar to adding hyper-threading status into SGX attestation reports [29]).
With the threat model re-instated, we now proceed to elaborate on our pro-
posed two-step countermeasure against DVFS-based fault attacks.
thread, we enumerate the entire search space of the independently controlled pa-
rameters: core frequency and core voltage. In order to control core voltage, the
DVFS thread uses the same mechanism as in [19, 14, 21]. Concretely, the DVFS
thread chooses a negative voltage offset x milli-volts, offsets the baseline voltage
by x milli-volts, and writes the corresponding value into MSR 0x150. In order
to compute the actual value to be written in line with semantics of MSR 0x150
(c.f. Sec. 2.3), Algo. 1 is used. Overall, the DVFS thread is executed as depicted
in Algo. 2. We first initialize an empty set referring to all unsafe states of the
system. Likewise, set F is initialized to contain all possible frequency values a
system core can support (with a resolution of 0.1 GHz), while the set V is ini-
tialized to contain negative voltage offsets. The latter choice is by design, since
all prior works [19, 14, 21] observed DVFS faults through undervolting only (i.e.
through consideration of negative voltage offsets while modifying core voltage).
The DVFS thread then iterates over all possible voltage-frequency pairs in order
to determine if the victim thread observed any faults. As evident from Algo. 2, we
use the cpupower Linux utility [18] to modify the core frequency. Likewise, we
use Algo. 1 to first compute the overall 64-bit value of MSR 0x150 that encapsu-
lates appropriately chosen negative voltage offset test voltage offset and then
uses Intel’s MSR memory mapped I/O interface [13] (abstracted in Algo. 2 as
MSR WRITE 0x150) to write into MSR 0x150. Then, the DVFS thread allows the
victim thread to execute carefully selected arithmetic operations (which we dis-
cuss next) and observes occurrence of incorrect computation, implying successful
fault injection. If a fault does indeed occur, then the DVFS thread considers the
corresponding tuple (test frequency, test voltage offset) as an unsafe state
of the system.
We now detail the operations of the EXECUTE thread. From [15, 14, 19],
the imul instruction has the maximum probability of being faulted by DVFS
styled attacks. Hence, in our characterization also, we use the imul instruction.
Concretely, the EXECUTE thread runs a tight loop of one million iterations of
imul instructions with varying 64-bit operands. A fault is said to occur if the
output of some imul instruction (while DVFS thread is operational) is differ-
ent from the actual output of the imul instruction (under normal operational
frequency/voltage settings). As evident from Algo. 2, the EXECUTE thread con-
tinues in parallel to the DVFS thread without blocking the latter’s execution,
thereby posing no problems of ensuring synchronization.
We now detail the characterizations of safe/unsafe states across three gen-
erations on Intel processors, depicted in Fig. 2, Fig. 3, and Fig. 3. As evident,
across the entire frequency spectrum of each system, we observe a range of
under-volted offsets where no DVFS related faults are observed. Additionally,
for any given frequency on all three systems, after a certain undervolt offset,
we start to observe a region of interest where faults begin to manifest. This is
exactly the point in execution where the system is no longer in a safe state, but
rather has entered into an unsafe state. For each frequency, we keep character-
izing the width of the unsafe region (i.e. the range of undervolting offsets where
the system continues to be in unsafe states) until we observe a system crash.
14 N. Mishra et al.
UNSAFE system state SAFE system state Maximal SAFE system state
0
Voltage offsets (in milli-volts)
100
200
300
1.0 1.5 2.0 2.5 3.0 3.5
Frequency (in GHz)
UNSAFE system state SAFE system state Maximal SAFE system state
0
Voltage offsets (in milli-volts)
50
100
150
0.5 1.0 1.5 2.0 2.5 3.0
Frequency (in GHz)
UNSAFE system state SAFE system state Maximal SAFE system state
0
Voltage offsets (in milli-volts)
50
100
150
0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5
Frequency (in GHz)
Once we have characterized the entire frequency spectrum, we have the tuples
of voltage-frequency values for which the target system is in an unsafe state.
1. The ioctl calls invoked in the kernel module that drives the MSR read/write
functionality [13].
2. The delay between a successful write to MSR 0x150 and the actual change
in voltage by the voltage regulator [19].
Plug Your Volt 17
Microcode [4, 16, 28] allows a layer atop a CPU to allow a mechanism to patch
CPU execution in-place without requiring any special hardware. Microcodes are
the prime carriers of patches that CPU vendors push in response to vulnerabili-
ties arising as a result of hardware optimizations (c.f. Sec. 2.1). Such microcode
updates are loaded through BIOS/UEFI and need to be loaded once the proces-
sor resets. At the time when an event takes place for which microcode interven-
tion is needed, a microcode sequencer kicks in and operates the entire decoding
process for subsequent micro-operations. The microcode sequencer is capable of
handling conditional microcode branches as well, making it an ideal choice for
implementing our countermeasure. Concretely, the microcode read-only memory
(ROM) stores the value of the maximal safe state and the microcode sequencer
kicks in a microcode conditional branch whenever a wrmsr (x86 instruction to
write to MSR) is executed on MSR 0x150. If the wrmsr instruction puts the
system into an unsafe state (by violating the maximal safe state boundary),
the conditional microcode branch simply ignores the write to 0x150. This write-
ignore behaviour is implemented upon several other MSRs as well [11].
The insight about using maximal safe state also allows for implementing the
countermeasure at the hardware level- as a Model Specific register. We propose to
follow the same MSR semantics as followed by MSRs 0x618 (MSR DRAM POWER LIMIT)
and 0x61C (MSR DRAM POWER INFO) [11]. The MSR MSR DRAM POWER LIMIT allows
software to set power limits for DRAM domain (this is analogous to writes to
MSR 0x150 in the context of our countermeasure). However, MSR MSR DRAM POWER INFO
allows to set a value DRAM MIN PWR which is the minimal power setting allowed for
DRAM power throttling. As such, any value lower than DRAM MIN PWR is clamped
to DRAM MIN PWR, which preventing any prospect of undervoltage induced faults
in the DRAM. As evident, this kind of MSR is exactly where our countermea-
sure can reside, incurring minimal hardware overhead of an additional MSR.
The CPU vendors can use an additional MSR (hypothetically referred here as
18 N. Mishra et al.
MSR VOLTAGE OFFSET LIMIT) which puts a clamp on 0x150 based on the max-
imal safe state characterization performed for a given CPU generation. This
allows MSR VOLTAGE OFFSET LIMIT to behave as a hardware gatekeeper against
any attempts to put the system into unsafe states, thereby providing a hardware
level countermeasure to DVFS fault attacks.
6 Conclusion
In this work, we take an orthogonal route from existing approaches to pro-
tect DVFS based fault attacks. Instead of preventing access to DVFS interface
or relying on compiler extensions, we focus on the root-cause of such DVFS-
style attacks and build a countermeasure around it. Along these lines, we first
put forth the perspective that modern system design allows independent con-
trol over a CPU core’s frequency and voltage. Since core frequency and core
voltage control different aspects of a CPU’s digital circuitry, there exist certain
voltage-frequency configurations that make a particular system more susceptible
to DVFS fault attacks. We enumerate such configurations for three Intel gener-
ations, and introduce the concept of safe-unsafe system states with respect to
DVFS fault attacks around such configurations.
Our countermeasure is then constructed around safe-unsafe characteriza-
tion of the system and implemented as a kernel module incurring an acceptable
overhead of 0.28%. Moreover, we also characterize maximal safe state of a
system, and discuss how our countermeasure (unlike previous works) has the
potential to be deployed at both the microcode level as well as the hardware
level (as a model-specific register).
From a countermeasure design perspective, by not allowing complete inde-
pendence in controlling core frequency and voltage, our countermeasure com-
pletely prevents DVFS faults. More importantly, unlike prior countermeasures,
it also allows access to DVFS features to benign non-SGX executions even when
SGX enclaves are executing. Therefore, we conclude that this countermeasure
design (utilizing the characterization of safe-unsafe system states) allows for
complete protection against DVFS attacks while allowing availability and flexi-
bility of DVFS features to non-SGX contexts within the purview of safe system
state, thereby not compromising majorly on the performance of a CPU core.
References
1. AMD: Amd64 architecture programmer’s manual volume 2: System programming
(2018)
2. Balaji, B., McCullough, J., Gupta, R.K., Agarwal, Y.: Accurate characterization
of the variability in power consumption in modern mobile processors. In: 2012
Workshop on Power-Aware Computing and Systems (HotPower 12) (2012)
3. Balch, M.: Complete digital design: a comprehensive guide to digital electronics
and computer system architecture. McGraw-Hill Education (2003)
4. Borrello, P., Easdon, C., Schwarzl, M., Czerny, R., Schwarz, M.: Customprocessin-
gunit: Reverse engineering and customization of intel microcode. WOOT (2023)
Plug Your Volt 19
5. Chen, G., Li, M., Zhang, F., Zhang, Y.: Defeating speculative-execution attacks
on sgx with hyperrace. In: 2019 IEEE Conference on Dependable and Secure Com-
puting (DSC). pp. 1–8. IEEE (2019)
6. Chen, Z., Vasilakis, G., Murdock, K., Dean, E., Oswald, D., Garcia, F.D.:
{VoltPillager}: Hardware-based fault injection attacks against intel {SGX} en-
claves using the {SVID} voltage scaling interface. In: 30th USENIX Security Sym-
posium (USENIX Security 21). pp. 699–716 (2021)
7. Documentation, K.: amd-pstate cpu performance scaling driver. https://docs.
kernel.org/admin-guide/pm/amd-pstate.html (2021)
8. kernel documentation, L.: Cpu performance scaling. https://www.kernel.org/
doc/html/v4.14/admin-guide/pm/cpufreq.html (2017)
9. documentation, L.K.: Cpufreq utilities. https://docs.kernel.org/cpu-freq/
core.html
10. Gruss, D., Lettner, J., Schuster, F., Ohrimenko, O., Haller, I., Costa, M.: Strong
and efficient cache {Side-Channel} protection using hardware transactional mem-
ory. In: 26th USENIX Security Symposium (USENIX Security 17). pp. 217–233
(2017)
11. Intel: Intel 64 and ia-32 architectures software developer manuals.
https://www.intel.com/content/www/us/en/developer/articles/technical/
intel-sdm.html (2013)
12. Intel: Intel processors voltage settings modification advisory. https://www.intel.
com/content/www/us/en/security-center/advisory/intel-sa-00289.html
(2019)
13. Intel: Intel msr tools. https://github.com/intel/msr-tools (2022)
14. Kenjar, Z., Frassetto, T., Gens, D., Franz, M., Sadeghi, A.R.: {V0LTpwn}: Attack-
ing x86 processor integrity from software. In: 29th USENIX Security Symposium
(USENIX Security 20). pp. 1445–1461 (2020)
15. Kogler, A., Gruss, D., Schwarz, M.: Minefield: A software-only protection for
{SGX} enclaves against {DVFS} attacks. In: 31st USENIX Security Symposium
(USENIX Security 22). pp. 4147–4164 (2022)
16. Koppe, P., Kollenda, B., Fyrbiak, M., Kison, C., Gawlik, R., Paar, C., Holz, T.: Re-
verse engineering x86 processor microcode. In: 26th USENIX Security Symposium
(USENIX Security 17). pp. 1163–1180 (2017)
17. Lipp, M., Kogler, A., Oswald, D., Schwarz, M., Easdon, C., Canella, C., Gruss,
D.: Platypus: Software-based power side-channel attacks on x86. In: 2021 IEEE
Symposium on Security and Privacy (SP). pp. 355–371. IEEE (2021)
18. manual, U.: Cpu power linux utility. https://manpages.ubuntu.com/manpages/
trusty/man1/cpupower.1.html (2011)
19. Murdock, K., Oswald, D., Garcia, F.D., Van Bulck, J., Gruss, D., Piessens, F.:
Plundervolt: Software-based fault injection attacks against intel sgx. In: 2020 IEEE
Symposium on Security and Privacy (SP). pp. 1466–1482. IEEE (2020)
20. Nilsson, A., Bideh, P.N., Brorsson, J.: A survey of published attacks on intel sgx.
arXiv preprint arXiv:2006.13598 (2020)
21. Qiu, P., Wang, D., Lyu, Y., Qu, G.: Voltjockey: Breaching trustzone by software-
controlled voltage manipulation over multi-core frequencies. In: Proceedings of the
2019 ACM SIGSAC Conference on Computer and Communications Security. pp.
195–209 (2019)
22. Schwarz, M., Lipp, M., Moghimi, D., Van Bulck, J., Stecklina, J., Prescher, T.,
Gruss, D.: Zombieload: Cross-privilege-boundary data sampling. In: Proceedings
of the 2019 ACM SIGSAC Conference on Computer and Communications Security.
pp. 753–768 (2019)
20 N. Mishra et al.
23. Shih, M.W., Lee, S., Kim, T., Peinado, M.: T-sgx: Eradicating controlled-channel
attacks against enclave programs. In: NDSS (2017)
24. Tang, A., Sethumadhavan, S., Stolfo, S.: {CLKSCREW}: Exposing the perils of
{Security-Oblivious} energy management. In: 26th USENIX Security Symposium
(USENIX Security 17). pp. 1057–1074 (2017)
25. Tang, B.C.A.: Security Engineering of Hardware-Software Interfaces. Columbia
University (2018)
26. Van Bulck, J., Minkin, M., Weisse, O., Genkin, D., Kasikci, B., Piessens, F., Sil-
berstein, M., Wenisch, T.F., Yarom, Y., Strackx, R.: Foreshadow: Extracting the
keys to the intel {SGX} kingdom with transient {Out-of-Order} execution. In:
27th USENIX Security Symposium (USENIX Security 18). pp. 991–1008 (2018)
27. Van Bulck, J., Piessens, F., Strackx, R.: Sgx-step: A practical attack framework for
precise enclave execution control. In: Proceedings of the 2nd Workshop on System
Software for Trusted Execution. pp. 1–6 (2017)
28. Yang, Z., Li, Q., Zhang, P., Chen, Z.: Reverse engineering of intel microcode update
structure. IEEE Access 8, 169676–169687 (2020)
29. Zhou, J., Xiao, Y., Teodorescu, R., Zhang, Y.: Enclyzer: Automated analysis of
transient data leaks on intel sgx. In: 2022 IEEE International Symposium on Secure
and Private Execution Environment Design (SEED). pp. 145–156. IEEE (2022)