安全与密码学2021arxiv.org
指环王:针对 CPU 片上环形互连的侧信道攻击
Lord of the Ring(s): Side Channel Attacks on the CPU On-Chip Ring Interconnect
专业 · 约 70 分钟读完前置知识:CPU 缓存层次与 L3 slice、微架构侧信道、环形互连/CC-NUMA
导读
论文研究 Intel CPU 片上环形互连(ring interconnect)的侧信道问题:利用 L3 cache 由与各核心共置的多个 slice 组成、读写时在 ring 上产生争用,构建争用模型来推断受害者的缓存/内存访问模式,并进一步利用缓存 inclusivity 泄露每核私有的 L1/L2 信息。作者展示了对某些加密实现(如旧版 libgcrypt 的 EdDSA)的攻击潜力,但评论指出其现实可利用性受实现版本、权限和噪声条件限制。
HN 关注点:共享缓存/片上互连如何跨安全边界泄露信息,以及这类攻击对 Intel/AMD 的实际影响和论文实验条件的争议。
HN 评论精选
这几条评论里:质疑 1 补充 2 亲历 1
补充专业解读:L3 实为 CC-NUMA,利用 ring 争用监控 LLC,并需 cache slice 分区等缓解。
这是一篇很好的论文,解释得很清楚。源码在 GitHub。简而言之:L3 cache(LLC)在芯片所有核心间共享,但 L3 由多个与各核心共置的 slice 组成,实际上是一种 CC-NUMA 结构。通过环形互连读写 L3 时存在争用,可用于识别缓存的内存地址访问模式。论文还涉及 Intel 缓存设计的 set inclusivity 属性如何泄露每核私有的 L1/L2。监控 LLC 的方法类似 eprint 2015/898,但未引用该文。这不是“游戏结束”式攻击,但强化了跨安全边界共享资源(缓存、内存、核心)是坏主意;VM 独占缓存区域(Intel CAT 缓存分区)和 cache locking 有帮助,但还需要 cache slice 分区。
angry_octet查看英文原文
This is a great paper, really well explained. The source code: https://github.com/FPSG-UIUC/lotr The TL;DR is that the L3 cache (LLC: Last Level Cache) is shared between all cores on the chip, but the L3 is composed of a number of slices colocated with each core: the L3 is actually CC-NUMA! There is contention when reading/writing to the L3 via the ring interconnect, which can be used to identify the memory addresses access patterns of the cache. There's a bit more covering how the L1/L2 caches, private to each core, are revealed via the set inclusivity properly of Intel's cache design. In monitoring LLC it is similar to https://eprint.iacr.org/2015/898.pdf though it doesn't reference them. It isn't a game over attack but it reinforces how sharing resources (cache, memory, cores) is a bad idea when that crosses a security boundary. VM exclusive cache regions (Intel CAT cache partitioning) and cache locking should help, but cache slice partitioning is reqd too.
质疑质疑实用性:攻击依赖过时 libgcrypt、需 root/模拟,且后台线程噪声可轻易淹没信号。
我过去几年读了很多这类侧信道论文。第一,这项新技术可能无法攻击“真实”的加密软件。这类论文常见手法是攻击过时版本的 libgcrypt,因为旧版这个相对冷门的库未使用常数时间代码。人们实际使用的现代已修补实现不会通过此技术泄露,论文结尾也承认这一点;而且 libgcrypt 多年前就已修补,论文引用的版本号并不说明这点,要查发布历史才知道。第二,这篇论文有大量步骤是模拟或简化(例如需要 root),在实验室演示之外可用前还有工作要做。至于从打字模式提取密码,仔细读那部分会看到巨大 caveat:只需 2 个后台线程,信号就被噪声淹没;4 个线程则完全丢失信号。所以似乎有简单缓解,且在中等负载服务器上能否工作也不清楚。
thu2111查看英文原文
I've read a lot of side channel papers like this one over the past few years. Here are some thoughts. Firstly, this new technique is probably not exploitable against 'real' cryptographic software. A very common technique in these papers that I see all the time these days is they attack obsolete versions of libgcrypt, because old versions of this relatively obscure crypto library aren't using constant time code. All modern and patched crypto implementations that people actually use would not leak using this technique, as the paper admits at the end. And even libgcrypt was patched years ago. The version number cited in the papers never makes this clear - you have to look up the release history to realise this. Secondly, this paper is a bit unusual in the sheer number of steps that are simulated or otherwise simplified by e.g. requiring root. It's got some work to do before it's usable outside of lab condition demonstrations. OK, so the crypto attack is theoretical and wouldn't work in real life, but what about the ability to extract passwords from typing patterns? Well, if we read that part of the paper carefully we can see a rather massive caveat: all it takes is 2 threads doing stuff in the background and the signal is drowned in noise. 4 threads doing stuff cause the signal to be entirely lost. So there seems to be a simple mitigation and it's unclear that this would work at all on a server that's under even moderate load. Moreover, whilst a casual reader may get the impression they can extract passwords, they don't actually demonstrate that. Rather, they demonstrate what they claim is "a very distinguishable pattern" in ring contention triggered by keystrokes, with "zero false positives and zero false negatives". That sounds impressive but no information is given on what they're comparing against: what were the other events that were being tested here? The obvious question in my mind is how much of the signal they're seeing came from the actual keystroke vs output being printed to a terminal emulator, in which case, I'd expect to see potential FPs caused by any printing to the terminal. Their victim program doesn't merely monitor keystrokes but they are also echoed to the terminal - which is not what happens during password input, where characters aren't visible. This mock victim program is not much like a real password input program as a consequence. Overall it's a clever paper, but I find myself increasingly fatigued by this genre of research. They seem to have settled into a template: • Attack Intel, ignore everything else. • Make grand and scary sounding claims • Only demonstrate them against deliberately crippled victim programs in very artificial conditions. It's been a few years now and I don't think any Spectre attack has ever been spotted in the wild, mounted by real attackers. That's true despite a huge state-sponsored attack having just been detected, that Microsoft claim might have had over 1000 developers work on it. Uarch side channel attacks sound cool but it seems real attackers either can't make them work, or have easier ways to get what they want. I find myself losing interest as a consequence.
补充补充限制:目标 libgcrypt EdDSA 并非常数时间实现,更好的实现更可能安全。
注意,作者调查的 EdDSA 实现(libgcrypt)不是常数时间实现。更好的实现更可能安全。参见相关讨论链接。
maxtaco查看英文原文
Note that the implementation of EdDSA that the authors investigated (libgcrypt) is not a constant-time implementation. Better implementations are more likely to be safe. See: https://news.ycombinator.com/item?id=21352821
亲历提醒 AMD Infinity Fabric 同样可用类似争用建模研究,攻击不限于 Intel。
最后,AMD CPU 使用其他专有技术 Infinity Fabric/Architecture 作为片上互连。研究我们的攻击在这些平台上的可行性需要未来工作,但我们用于构建争用模型的技术也可应用于这些平台。我注意到,这类侧信道报道传播时 Intel 常受打击而 AMD 兴盛;虽然多数攻击针对 Intel 芯片调优,但其背后理论加上相当工作量常可适用于 AMD,某些情况下甚至其他架构(ARM、MIPS、SPARC 等)。
molticrystal查看英文原文
>Finally, AMD CPUs utilize other proprietary technologies known as Infinity Fabric/Architecture for their on-chip interconnect. Investigating the feasibility of our attack on these platforms requires future work. However, the techniques we use to build our contention model can be applied on these platforms too. I notice often that when coverage of these side-channels start spreading Intel takes a hit and AMD thrives. While the majority of these side-channel attacks are tuned to Intel chips, the theory behind them along with a decent amount of work can often make them applicable to AMD as well, and in some cases even other architectures(ARM, MIPS, SPARC, etc).
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2021Hacker News 讨论帖188 分 · 55 评
同领域还值得读
如何入侵一台已关机的电脑:在 Intel ME 中运行未签名代码
How to hack a turned-off computer, or running unsigned code in Intel ME
这篇 Black Hat 2017 白皮书讨论 Intel Management Engine(ME)的安全问题:如何在 ME 中运行未签名代码,以及攻破处于关机状态的电脑的相关…
安全与密码学2017 · 543 分 · 107 评专业 · 约 40 分钟编辑精选比特币:一种点对点的电子现金系统(2008)
Bitcoin: A Peer-to-Peer Electronic Cash System (2008)
中本聪 2008 年发表的比特币白皮书,提出了无需可信第三方的点对点电子现金系统。
安全与密码学2017 · 536 分 · 394 评入门 · 约 45 分钟编辑精选GPRS 加密算法 GEA-1 的密码分析表明存在故意弱点
Cryptanalysis of GPRS Encryption Algorithms GEA-1 suggest intentional weakness
首次公开了对 GPRS 加密算法 GEA-1 和 GEA-2 的密码分析攻击。
安全与密码学2021 · 487 分 · 107 评专业 · 约 90 分钟编辑精选Signal 消息协议的形式化安全分析
A Formal Security Analysis of the Signal Messaging Protocol
用形式化方法分析 Signal 消息协议(TextSecure)的安全性:作者在多阶段密钥交换模型下,借助自动化证明工具对协议的密钥协商与 Double Ratchet 密钥更新…
安全与密码学2016 · 353 分 · 230 评专业 · 约 120 分钟编辑精选A2:模拟恶意硬件
A2: Analog Malicious Hardware
论文研究如何在芯片设计阶段植入模拟电路形式的恶意硬件后门,使其难以被常规检测发现。
安全与密码学2016 · 315 分 · 94 评专业 · 约 75 分钟编辑精选