Skip to content

Commit

Permalink
Add more meltdown details
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Jan 31, 2025
1 parent a73ed3c commit 6af9f44
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/hardware/cpu_vulnerabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
## Meltdown

- [论文 Meltdown: Reading Kernel Memory from User Space](https://meltdownattack.com/meltdown.pdf)
- [CVE-2017-5754](https://nvd.nist.gov/vuln/detail/cve-2017-5754)
- [Rogue Data Cache Load / CVE-2017-5754 / INTEL-SA-00088](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/advisory-guidance/rogue-data-cache-load.html)
- 允许用户态程序读取完整的内核态地址空间
- 原理:
- 硬件为了性能,在验证 load 指令的权限是否正确之前,提前把 load 指令的结果传递给了后续的指令,后续发现 load 指令的的权限错误后,再进行回滚
- 在用户态的时候,页表中内核态的地址也被映射了,只不过设置了权限位,禁止用户态访问
- 在用户态访问内核态地址会触发异常,但如果 load 指令的结果通过某种方式带来了副作用,就可以知道 load 的结果是多少
- 为了利用副作用来得到 load 指令的结果,首先把一个数组从缓存中清空,再把 load 指令的结果移位后作为下标去访问数组,那么副作用就是把对应位置的缓存行加载到缓存当中
- 最后再测量缓存行的访问时间,从而知道之前哪个缓存行通过副作用被加载到缓存当中,从而得到 load 指令的结果,而这本来是只有在内核态才能访问的数据
- 由于时间窗口比较小,如果访问的内核态的数据不在 L1 数据缓存中,可能会来不及产生副作用
- 代码:
```asm
; rcx = kernel address, rbx = probe array
Expand Down

0 comments on commit 6af9f44

Please sign in to comment.