FPGA2019 Tutorial
FPGA2019 Tutorial
Document Version
Proof
Published in:
28th ACM/SIGDA International Symposium on Field-Programmable Gate Arrays (FPGA)
General rights
Copyright and moral rights for the publications made accessible in the Research Explorer are retained by the
authors and/or other copyright owners and it is a condition of accessing publications that users recognise and
abide by the legal requirements associated with these rights.
Takedown policy
If you believe that this document breaches copyright please refer to the University of Manchester’s Takedown
Procedures [http://man.ac.uk/04Y6Bo] or contact [email protected] providing
relevant details, so we can investigate your claim.
Users put on
crypto-graphic User B
core
Figure 1: Denial-of-service-like (DoS-like) threat model. A Figure 2: An illustration of the eavesdropping threat model
user may try to shutdown an FPGA service in a data center of user confidentiality in a multi-tenant computing environ-
by sending malicious circuits such that legitimate requests ment.
from other users cannot use the FPGA resources. Short-
Although all current power hammering attacks are leveraging
circuits and power hammering designs can be utilized for
self-oscilating circuits, glitch amplification can potentially be uti-
such attacks on the system availability. This kind of attack
lized for this purpose as shown in Figure 3.
may potentially age or damage the equipment.
2.1 Attacks on the system availability 2.2 Attacks on the user confidentiality
Denial-of-service-like (DoS-like) attacks are used to bring down Side-channel attacks on FPGAs can be either active (e.g., timing
active infrastructures and/or to compromise states in other system fault injection) or passive (e.g., power analysis, crosstalk coupling,
components which stay outside the scope of an attacking module, as electromagnetic analysis, and thermal channel leakage [16]). In
illustrated in Figure 1. At the electrical level, two means for DoS-like [14], timing faults have been injected through a large number of
attacks had been utilized: short-circuits and power hammering. ring oscillators to cause voltage drops followed by analyzing the
Short-circuits on modern FPGAs have been demonstrated in [1] resulting faulty cipher text using Differential Fault Analysis (DFA)
within the multiplexers inside a switch matrix using a manipulated for successfully revealing the secret key of a crypto-core. The idea
configuration bitstream resulting in a huge current increase (with of most timing fault injection attacks is to temporarily create a huge
several mA extra current for a single multiplexer). While the FPGA power demand (e.g., by starting a large number of ring oscillators).
vendor tools ensure that generated bitstream are short-circuit free, This will reduce the FPGAs supply voltage and may in turn slow
an attacker can create shorts relatively easily. In fact, in [8], short- down a path in a victim circuit such that it may fail timing.
circuits had been used for obfuscating power traces from an AES Power analysis attacks have been demonstrated to leak the se-
core to make power analysis attacks much harder to perform. cret key of a cryptographic function that was running on the same
Power hammering is another mechanism to carry out DoS-like FPGA [21], running on a CPU embedded on the same FPGA die [27],
attacks. All current power hammering attacks [7] are based on and running on a different FPGA on the same FPGA board [22].
fast toggling circuits in order to draw a substantial amount of All these attacks have in common that they use ring-oscillators to
dynamic power. We will show in Section 3 that it is possible to measure key-dependent fluctuations on the voltage. In addition to
implement ring oscillators running in the GHz frequency domain sensing voltage, self-oscillators can be used to monitor crosstalk
with a corresponding dynamic power footprint. In [7], a grid of effects [5, 6, 20]. In these studies, it was found that a long wire
ring oscillators was activated at an adjustable rate (to stimulate carrying a logical 1 will slow down a ring-oscillator that is imple-
resonance effects in the power supply regulation circuit). With this, mented using an adjacent wire. Therefore, by taking advantage
several FPGA platforms such as Xilinx Virtex 6, Kintex 7, and Zynq- of the sensitivity of self-oscillators, attackers can leak the current
7000 FPGAs had been crashed (and in some cases requiring power- state of a signal which is a concern in shared FPGA infrastructures.
cycling for bringing up boards back into service). In this tutorial,
we will examine the potential for power hammering in more detail
in Section 4. Although ring-oscillators are usually flagged with a
2.3 State-of-the-art countermeasures
warning by the vendor design tool flows and hence, not allowed The main schemes to prevent side-channel power analysis attacks
to be deployed on any cloud or data center infrastructure, a recent are based on masking and hiding strategies. In the masking strategy,
research [6] has reported new ring-oscillator designs which can an implementation of a cryptographic algorithm is transformed to
bypass such Design Rule Checking (DRC). A simple trick to bypass another (typically larger) variant which is functionally equivalent,
DRC is implementing a ring oscillator passing through an enabled but where the new circuit is able to remain secure although the
transparent latch. With this, ROs could be deployed, for example, attacker can observe some details of the operation through a side-
on Amazon F1 instances. channel, as proposed in [11]. This makes power analysis attacks
much harder as the data leaked has also to be correlated with the
same manufacturing process and the same UltraScale+ FPGA fabric
Glitch architecture than what is provided in current Xilinx datacenter
signal
SET
FPGA boards, like the popular Alveo U200/250 FPGA boards. The
D Q best design found for Ultra96 will then be tested at scale on an
Alveo U200 board.
I5 I5
enable I4 enable I4
I3 I3
I2 I2
I1 I1
I0 I0
RO_1 RO_0
100
Power Consumption (W)
350
Internal Voltage (V)
350
Temperature (oC)
0.82
300 300 80
0.8 250
250
60
200
200 0.78
150 40
150
0.76
100
100
20
0.74 50
50
0 0
0 0.72 0.00% 5.00% 10.00% 15.00%
0.00% 5.00% 10.00% 15.00%
v i r u s s c a n n e r − i i n p u t _ d e s i g n . j s o n −c c o n f i g .
Figure 13: A snippet of a single edge of the implementation i n i −o o u t p u t . t x t
graph. The above command runs FPGADefender on the implemented
After parsing the implementation graph, scanning options are graph given by the input_design.json file based on the options
parsed to provide inputs for the virus detector engine as well as set in the config.ini file and outputs the results to the output.txt
filters. FPGADefender allows specifying a positive filter to describe file.
configurations that must exist in the original bitstream (e.g., a spe- The config file is used to configure FPGADefender and the
cific connection through which a partially reconfigurable module tools it uses. The configuration file is parsed using the Python’s
communicates with the surrounding shell infrastructure). Corre- ConfigParser package and therefore it consists of sections and
spondingly, a negative filter allows describing primitives and rout- options. The configuration file should have the following items
ing resources that are prohibited in a bitstream. In detail, the scan- specified:
ning process executes the following set of virus detector engines:
• virus_signatures: Names of the virus signature packages to
• Combinational cycle detector: Detect combinatorial cycles. be executed
This includes detecting cycles that use transparent latches – Specific virus_signature options described in the next sec-
in order to prevent the attack revealed in [23]. tion
• Attribute detector: Detect asynchronous design elements • connection_attributes: Optional section for adding attributes
such as using latches. to connections
• Port detector: Detect prohibited ports. For example, this – attributes_file: Path to the CSV file describing which con-
allows it to detect if a partial module tries leaking to a port nections get which attributes.
not belonging to its allocated partial region. • removables
• Path detector: Detect prohibited paths. For example, detect if – connections_file - Path to a text file describing which
a partial module tries accessing a static route that is crossing connections should be removed from the implementation
a partial region (note that we explicitly allow static routes graph before the scans.
which are commonly used in complex designs).
• Antenna detector: Detect dangling paths. This is in most The different available virus signatures can be set up in the
cases rather a warning that a module may have an interface config file by adding the name of the virus signature class under
wire not properly connected. the virus_signatures section, as shown in Table 1.
Virus Scanner flow
netlist GN
Result represented
in text file
This will install the executables using the PyInstaller tool got To add more than one signature, the .spec file can be modified.
from pip. When building the executable, we have to make sure to
add the virus scanner packages given in the config file as hidden 5 SCAN RESULTS
imports, as shown in the following example: We ran FPGADefender on a benchmark of malicious bitstreams
and this section presents briefly the results. As a sanity check, we
also ran scans on bitstreams that do not contain malicious circuits
and FPGADefender had not reported any issue, except for one case:
a true random number generator that actually uses ring-oscillators
as a source of randomness. In detail we provide the following re-
ports:
• Combinatorial loop and transparent latch detection are re-
ported in Figure 15. The file lists a couple of cycles detected.
Each cycle starts with a status line stating the specific class
of ring-oscillator. FPGADefender supports detecting ROs
through LUTs, cascading multiplexers (MUX7/MUX8 in Xil-
inx notation), CLA carry logic, DSP blocks and latches. After
this the entire first cycle of each class is reported. This can
be identified by the first and last entry of each cycle pointing
to the same node.
• Short-circuits are reported in Figure 16. This section reports
first the number of short circuit situations found and then
list for the first detected switch matrix multiplexer the input
ports activated. Each switch matrix multiplexer can only
connect to no port (if not used) or to at most one of its
available inputs.
• Latches are reported in Figure 17. This section reports latches
used in cycles but also all other latches which are not mali-
cious, but which indicates that the bitstream was not imple-
mented following good RTL design principles.
• Antennas are reported in Figure 18. The report lists the last
port of an antenna which allows investigating the antenna
issue using the Vivado tool suite.
• Fan-outs are reported in Figure 19. The fan-out report lists
the nets with the highest fan-out in the design. The number
of nets reported is specified in the config file.