#### Zhang Yuexin

C# programmer. Know a bit of hardware knowledge. 3D model design novice. # 翻译：为什么树莓派不会受到 Spectre 和 Meltdown 攻击 ``````t = a+b
u = c+d
v = e+f
w = v+g
x = h+i
y = j+k
``````

## 什么是超标量处理器

``````t, u = a+b, c+d
v, w = e+f, v+g
x, y = h+i, j+k
``````

``````t, u = a+b, c+d
v    = e+f                   # second pipe does nothing here
w, x = v+g, h+i
y    = j+k
``````

## 什么是乱序处理器

``````t = a+b
u = c+d
v = e+f
x = h+i
w = v+g
y = j+k
``````

``````t, u = a+b, c+d
v, x = e+f, h+i
w, y = v+g, j+k
``````

## 什么是推测

``````t = a+b
u = t+c
v = u+d
if v:
w = e+f
x = w+g
y = x+h
``````

``````t = a+b
u = t+c
v = u+d
w_ = e+f
x_ = w_+g
y_ = x_+h
if v:
w, x, y = w_, x_, y_
``````

``````t, w_ = a+b, e+f
u, x_ = t+c, w_+g
v, y_ = u+d, x_+h
if v:
w, x, y = w_, x_, y_
``````

## 什么是缓存

``````a = mem
b = mem
``````

``````a = mem    # 100ns delay, copies mem[0:15] into cache
b = mem    # mem is in the cache
``````

## 什么是侧信道

Spectre 和 Meltdown 是侧信道攻击, 它推断出内存位置的内容, 而内存位置通常不应使用定时来观察当前缓存中是否存在另一个可访问的位置。

## 综上所述

``````t = a+b
u = t+c
v = u+d
if v:
w = kern_mem[address]   # if we get here, fault
x = w&0x100
y = user_mem[x]
``````

``````t, w_ = a+b, kern_mem[address]
u, x_ = t+c, w_&0x100
v, y_ = u+d, user_mem[x_]

if v:
# fault
w, x, y = w_, x_, y_      # we never get here
``````

• v 为零，因此非法读取的结果不会被提交到 w
• v 为非零，但在将读取提交到 w 之前发生故障

``````v, y_ = u+d, user_mem[x_]
``````

## 结论

发表评论
{"ft_lang_label":"__label__zh","ft_lang_prob":0.9710811,"math_prob":0.999959,"size":5725,"snap":"2019-35-2019-39","text_gpt3_token_len":4384,"char_repetition_ratio":0.08914525,"word_repetition_ratio":0.1008547,"special_character_ratio":0.23580787,"punctuation_ratio":0.07212056,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.0000007,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,6,null,6,null,6,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-08-17T15:55:07Z\",\"WARC-Record-ID\":\"<urn:uuid:3ca79bd3-0b97-4903-a09a-05be4183d953>\",\"Content-Length\":\"39288\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f291014f-33ad-4c81-bb48-8ab04d738d32>\",\"WARC-Concurrent-To\":\"<urn:uuid:cede1bc5-0431-4734-8f82-6175090f0cea>\",\"WARC-IP-Address\":\"119.3.215.241\",\"WARC-Target-URI\":\"https://zhangyue.xin/Article/Content/34\",\"WARC-Payload-Digest\":\"sha1:HGCA4SFCU3BLV24XSWZYSQXPVLDDCSMM\",\"WARC-Block-Digest\":\"sha1:4QZP37AWEJJ6FE57MFJDYYYYFK77B424\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-35/CC-MAIN-2019-35_segments_1566027313428.28_warc_CC-MAIN-20190817143039-20190817165039-00275.warc.gz\"}"}