summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2019-04-24 16:01:15 +0800
committerIru Cai <mytbk920423@gmail.com>2019-04-24 16:01:15 +0800
commit313b40908e4b751b746d993549217fa6352904e6 (patch)
tree9e01d52dd840c6b96f429db7719de63f621b3dae
parentfb0e8ad0c8747b14ccfec5cb846e9bc6901f5725 (diff)
downloaddissertation-313b40908e4b751b746d993549217fa6352904e6.tar.xz
update
-rw-r--r--Makefile2
-rw-r--r--chap/chap2.tex76
-rw-r--r--chap/chap3.tex46
-rw-r--r--thesis.bib19
4 files changed, 134 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 7edfe18..7437115 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
# 被编译的主文件的文件名,不包括扩展名。
JOB = thesis
# 这个变量的值可以为 latex、pdflatex 或 xelatex。
-LATEX = pdflatex
+LATEX = latex
BIBTEX = biber -l zh__pinyin --output-safechars
DVIPDF = dvipdfmx
diff --git a/chap/chap2.tex b/chap/chap2.tex
index 8283046..db31b04 100644
--- a/chap/chap2.tex
+++ b/chap/chap2.tex
@@ -7,14 +7,90 @@
\section{Meltdown和Spectre攻击}
+Meltdown\supercite{meltdown} 和 Spectre\supercite{spectre} 是最早发现
+的两个利用瞬时指令的攻击。此后发现了更多的 Meltdown 和 Spectre 的变体。
+为了找出更多的攻击类型和分析它们的防御方案,Claudio Canella 等人对这些
+攻击及其防御做了系统性的研究\supercite{systematic},将所有瞬时执行攻击
+分为 Meltdown型攻击和 Spectre 型攻击两类。
+
\subsection{Meltdown型攻击}
+Meltdown型攻击利用的是处理器异常产生的瞬时指令,这些指令使用了体系结构
+层次上不可访问的数据,从而绕过硬件的安全策略,泄露体系结构层次上不可访
+问的数据。
+
\subsubsection{Meltdown}
+操作系统将内核地址空间映射至每个用户进程的地址空间中。处理器执行访存指
+令时,在将虚拟地址翻译为物理地址的时候,检查地址对应的权限位,判断用户
+是否可访问该地址。Meltdown攻击中,攻击者让处理器从用户不可访问的内核地
+址装载数据至寄存器,由于所有内核地址都可以翻译为合法的物理地址,处理器
+可以读取内核地址空间的数据,在产生异常前,攻击者构造的瞬时指令序列可以
+将读取到的数据通过隐蔽信道发送给攻击者。
+
\subsubsection{Foreshadow}
+Foreshadow\supercite{foreshadow} 是一种可以读取 Intel SGX enclave 中秘
+密数据的Meltdown 型攻击。如果对 SGX 使用 Meltdown 攻击,攻击者读取未授
+权的 enclave 内存,不会产生异常,而是读出 abort page 值 -1. 但是 abort
+page 只在页权限检查通过后发生,攻击者可以将该页 present 位清除,即将该
+页设为不存在,此时处理器便会产生异常,但由于一级缓存使用虚拟地址索引,
+因此仍然可以从一级缓存读取该虚拟地址中的数据,从而瞬时指令可以泄露 SGX
+enclave 中的数据。
+
+通过将一个页设为不存在,绕过地址翻译,从一级缓存读取数据的攻击方式,
+Intel 将其称为L1终端错误(L1 Terminal Fault)\supercite{l1tf}。
+Foreshadow-NG\supercite{foreshadowNG} 利用这种攻击方法,可以绕过操作系
+统和虚拟机的隔离。
+
\subsubsection{LazyFP}
+\supercite{lazyfp}
+
\subsection{Spectre型攻击}
+Spectre 型攻击利用处理器对控制流或数据流的预测,并进行推测式执行产生的
+瞬时指令。Spectre 型攻击中,瞬时指令访问的是程序在体系结构层面能访问的
+数据,可以绕过软件定义的安全策略,如边界检查等。
+
+\subsubsection{Spectre-PHT}
+
+Spectre-PHT 利用分支预测器,攻击者可以训练转移预测器,使得转移预测器执
+行一个分支,该分支的指令序列可以泄露受害者地址空间或寄存器的信息。
+
+Spectre v1 是 Spectre-PHT 类型的 Spectre 攻击。
+
+推测式缓冲区溢出(Speculative Buffer Overflow)
+\supercite{spec-buffer-overflow} 是 Spectre-PHT 的另一种形式。
+
+\subsubsection{Spectre-BTB}
+
+Spectre-BTB 利用间接转移,包含的攻击为 Spectre v2. 攻击者寻找受害者地
+址空间中的一个组件(gadget),它可以通过隐蔽信道泄露受害者地址空间中的
+数据。攻击者训练处理器的 BTB 使得受害者的间接转移指令的预测的目标地址
+为该组件的地址,从而受害者推测式执行这个组件的指令。训练 BTB 的过程可
+以在攻击者的地址空间中进行。
+
+\subsubsection{Spectre-RSB}
+
+返回栈(RSB)用于预测程序函数调用的返回地址。如果 RSB 中的返回地址和实
+际返回地址不同,则会产生错误的推测式执行,
+SpectreRSB\supercite{spectre-returns}\supercite{ret2spec} 利用了这种错
+误的推测式执行进行攻击。
+
+Spectre-RSB 的利用方式包括使 RSB 溢出,及污染 RSB. RSB 的大小为普通程
+序函数调用深度,调用深度超过 RSB 的大小时,会造成RSB 溢出,覆盖其中最
+老的条目,在函数返回时,会发生 RSB 下溢出。而有的处理器在 RSB 为空时,
+使用 BTB 进行转移预测,攻击者可以用 Spectre-BTB 的攻击方式进行攻击。污
+染 RSB 的方法包括在处理器的不同上下文中使用 RSB,推测式污染 RSB 等。
+
+\subsubsection{Spectre-STL}
+
+Spectre v4 利用的是 load 指令的推测式执行。处理器执行 load 指令时,如
+果此前有地址未知的 store 指令,会认为这个 load 指令和这些地址未知的
+store 指令地址不同,并推测式执行这个 load 指令,将其地址中的值装入目的
+寄存器。如果在计算出 store 的地址后,发现和已执行 load 访问了相同数据,
+则处理器需要重新执行这个 load 和之后的指令。在推测式执行的过程中,瞬时
+指令可以泄露这个地址中的旧值。
+
% vim:ts=4:sw=4
diff --git a/chap/chap3.tex b/chap/chap3.tex
index b0cede8..4d792a8 100644
--- a/chap/chap3.tex
+++ b/chap/chap3.tex
@@ -7,20 +7,56 @@
Meltdown型攻击利用了瞬时指令可以读取体系结构层次上不可访问的数据,并且用此数据做计算。因此一种防御方式是使体系结构层次上不可访问的数据,在微架构层次上仍然不可访问。
-KAISER\cite{kaiser}是一种已经部署在Linux内核上的一种防御Meltdown攻击的方案。它的作用是在用户空间中去除内核空间的地址映射,使得用户空间的执行的指令无法访问内核空间的存储区域。
+KAISER\supercite{kaiser}是一种已经部署在 Linux 内核上的一种防御
+Meltdown 攻击的方案。它的作用是在用户空间中去除内核空间的地址映射,使
+得用户空间的执行的指令无法访问内核空间的存储区域。
-防御Meltdown型攻击的第二种方法是阻止异常的产生。
+防御 Meltdown 型攻击的第二种方法是阻止异常的产生。
\section{Spectre型攻击的防御}
-Spectre型攻击的防御方案可以分为三类:阻止推测式执行、防止瞬时指令访问秘密数据、切断隐蔽信道或降低隐蔽信道的精度。
+Spectre 型攻击的防御方案可以分为三类:阻止推测式执行、防止瞬时指令访问
+秘密数据、切断隐蔽信道或降低隐蔽信道的精度。
\subsection{软件防御方案}
-为了防御Spectre v1,Intel和AMD建议在分支指令后插入lfence指令阻止推测式执行。由于lfence性能开销大,LLVM提出推测式装载指令加固(Speculative Load Hardening)技术,
-它的作用是在指令流中添加数据相关,使得装载指令使用的地址依赖于分支结果。
+为了防御Spectre v1,Intel和AMD建议在分支指令后插入lfence指令阻止推测式
+执行。由于lfence性能开销大,LLVM提出推测式装载指令加固(Speculative
+ Load Hardening)\supercite{spec-load-hardening} 技术,它的作用是在指
+令流中添加数据相关,使得装载指令使用的地址依赖于分支结果。
+retpoline\supercite{retpoline} 是 Google 提出的防御 Spectre-BTB 的方法。
+它的作用是把程序中的间接转移指令修改为一个指令序列,最终使用 ret 指令
+完成跳转,从而使用 RSB 而不是 BTB 来进行间接转移的转移预测。
+
+% index masking
+
+% poison value
+
+% site isolation
+
+% timer reduction
\subsection{硬件防御方案}
+\subsubsection{SafeSpec}
+
+\supercite{safespec}
+
+\subsubsection{InvisiSpec}
+
+\supercite{invisispec}
+
+\subsubsection{DAWG}
+
+\supercite{dawg}
+
+\subsubsection{Context-Sensitive Fencing}
+
+\supercite{context-sensitive-fencing}
+
+\subsubsection{Conditional Speculation}
+
+\supercite{conditional-speculation}
+
% vim:ts=4:sw=4
diff --git a/thesis.bib b/thesis.bib
index cf53a59..a6fe84c 100644
--- a/thesis.bib
+++ b/thesis.bib
@@ -28,7 +28,7 @@
}
@inproceedings{spectre,
- author = {Paul Kocher and Jann Horn and Anders Fogh and and Daniel Genkin and Daniel Gruss and Werner Haas and Mike Hamburg and Moritz Lipp and Stefan Mangard and Thomas Prescher and Michael Schwarz and Yuval Yarom},
+ author = {Paul Kocher and Jann Horn and Anders Fogh and Daniel Genkin and Daniel Gruss and Werner Haas and Mike Hamburg and Moritz Lipp and Stefan Mangard and Thomas Prescher and Michael Schwarz and Yuval Yarom},
title = {Spectre Attacks: Exploiting Speculative Execution},
booktitle = {40th IEEE Symposium on Security and Privacy (S\&P'19)},
year = {2019},
@@ -159,11 +159,11 @@
}
@online{spec-load-hardening,
- title={RFC: Speculative Load Hardening (a Spectre variant #1 mitigation)},
+ title={Speculative Load Hardening},
author={Chandler Carruth},
year={2018},
month={March},
- url={https://lists.llvm.org/pipermail/llvm-dev/2018-March/122085.html}
+ url={https://releases.llvm.org/8.0.0/docs/SpeculativeLoadHardening.html}
}
% looks like there's some useful references
@@ -338,6 +338,19 @@ This thesis highlights two aspects of the BOOM design: its industry-competitive
note = {\url{https://eprint.iacr.org/2018/808}},
}
+@INPROCEEDINGS{conditional-speculation,
+ author={P. {Li} and L. {Zhao} and R. {Hou} and L. {Zhang} and D. {Meng}},
+ booktitle={2019 IEEE International Symposium on High Performance Computer Architecture (HPCA)},
+ title={Conditional Speculation: An Effective Approach to Safeguard Out-of-Order Execution Against Spectre Attacks},
+ year={2019},
+ volume={},
+ number={},
+ pages={264-276},
+ keywords={cache storage;computer architecture;microprocessor chips;program diagnostics;security of data;trusted page buffer;cachehit based hazard filter;conditional speculation;spectre vulnerabilities;false security hazards;unsafe instructions;safe instructions;classic out-of-order pipeline;suspect speculation flags;security-dependent instructions;potential security risk;speculative memory instructions;security dependence;software transparent defense mechanism;security consideration;speculative execution;spectre attacks;out-of-order execution;Security;Hazards;Out of order;Microprocessors;Registers;Spectre vulnerabilities defense;Security dependence;Speculative execution side-channel vulnerabilities},
+ doi={10.1109/HPCA.2019.00043},
+ ISSN={2378-203X},
+ month={Feb},}
+
% looks useful...
@INPROCEEDINGS{poisonivy,
author={T. S. {Lehman} and A. D. {Hilton} and B. C. {Lee}},