Lune

NDSS2022顶会

Preventing Kernel Hacks with HAKCs

Derrick Paul McKee, Yianni Giannaris, Carolina Ortega, Howard E. Shrobe, Mathias Payer, Hamed Okhravi, Nathan Burow

摘要

Commodity operating system kernels remain monolithic for practical and historical reasons. All kernel code shares a single address space, executes with elevated processor privileges, and has largely unhindered access to all data, including data irrelevant to the completion of a specific task. Applying the principle of least privilege, which limits available resources only to those needed to perform a particular task, to compartmentalize the kernel would realize major security gains, similar to microkernels yet without the major redesign effort. Here, we introduce a compartmentalization design, called a Hardware-Assisted Kernel Compartmentalization (HAKC), that approximates least privilege separation, while minimizing both developer effort and performance overhead. HAKC divides code and data into separate partitions, and specifies an access policy for each partition. Data is owned by a single partition, and a partition's access-control policy is enforced at runtime, preventing unauthorized data access. When a partition needs to transfer control flow to outside itself, data ownership is transferred to the target, and transferred back upon return. The HAKC design allows for isolating code and data from the rest of the kernel, without utilizing any additional Trusted Computing Base while compartmentalized code is executing. Instead, HAKC relies on hardware for enforcement.

Loadable kernel modules (LKMs), which dynamically load kernel code and data providing specialized functionality, are the single largest part of the Linux source base. Unfortunately, their collective size and complexity makes LKMs the cause of the majority of CVEs issued for the Linux kernel. The combination of a large attack surface in kernel modules, and the monolithic design of the Linux kernel, make LKMs ideal candidates for compartmentalization. To demonstrate the effectiveness of our approach, we implement HAKC in Linux v5.10 using extensions to the Arm v8.5-A ISA, and compartmentalize the ipv6.ko LKM, which consists of over 55k LOC. The average overhead measured in Apachebench tests was just 1.6%-24%. Additionally, we compartmentalize the nf_tables.ko packet filtering LKM, and measure the combined impact of using both LKMs. We find a reasonable linear growth in overhead when both compartmentalized LKMs are used. Finally, we measure no significant difference in performance when using the compartmentalized ipv6.ko LKM over the unmodified LKM during real-world web browsing experiments on the Alexa Top 50 websites. DISTRIBUTION STATEMENT A. Approved for public release. Distribution is unlimited. This material is based upon work supported by the Under Secretary of Defense for Research and Engineering under Air Force Contract No. FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Under Secretary of Defense for Research and Engineering.

As an example of a high severity Linux CVE, consider CVE-2016-4997 [65] listed in Listing 1. The code is part of the IPv4 packet filtering subsystem, and is executed during error cleanup. The exploit involves the attacker supplying a small positive integer value via a system call, which, due to the LKM only performing an upper bound test and not a lower bound test, can lead to a corruption of a structure submember used as an offset value in a pointer computation. The pointer, computed using the offset submember corrupted by the user, is then written to the me pointer in line 7, which decrements an underlying integer, allowing an arbitrary kernel integer (e.g., the current process UID) to be decremented. This exploit is an example of a data-only attack that allows for accessing data beyond what the developer intended, which

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 18 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • SANCTUARY: ARMing TrustZone with User-space Enclaves 引用了 Spectre Attacks: Exploiting Speculative Execution
  • Manipulative Interference Attacks 引用了 ERIM: Secure, Efficient In-process Isolation with Protection Keys (MPK)
  • Meltdown: Reading Kernel Memory from User Space 引用了 Spectre Attacks: Exploiting Speculative Execution
  • LatticeBox: A Hardware-Software Co-Designed Framework for Scalable and Low-Latency Compartmentalization 引用了 ERIM: Secure, Efficient In-process Isolation with Protection Keys (MPK)
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper18

  1. Velosiraptor: Code Synthesis for Memory TranslationReto Achermann, Em Chu, Ryan Mehri, Ilias Karimalis 等ASPLOS 2025 · 3 次引用
  2. Hacksaw: Hardware-Centric Kernel Debloating via Device Inventory and Dependency AnalysisZhenghao Hu, Sangho Lee, Marcus PeinadoCCS 2023 · 3 次引用
  3. Manipulative Interference AttacksSamuel Mergendahl, Stephen Fickas, Boyana Norris, Richard SkowyraCCS 2024 · 1 次引用
  4. LatticeBox: A Hardware-Software Co-Designed Framework for Scalable and Low-Latency CompartmentalizationZhanpeng Liu, Chenyang Li, Wende Tan, Yuan Li 等NDSS 2026 · 1 次引用
  5. DirtyFree: Simplified Data-Oriented Programming in the Linux KernelYoochan Lee, Hyuk Kwon, Thorsten HolzNDSS 2026 · 1 次引用

它引用的 Paper27

  1. Spectre Attacks: Exploiting Speculative ExecutionPaul Kocher, Jann Horn, Anders Fogh, Daniel Genkin 等S&P 2019 · 2,435 次引用
  2. Meltdown: Reading Kernel Memory from User SpaceMoritz Lipp, Michael Schwarz, Daniel Gruss, Thomas Prescher 等USENIX Security 2018 · 1,456 次引用
  3. ERIM: Secure, Efficient In-process Isolation with Protection Keys (MPK)Anjo Vahldiek-Oberwagner, Eslam Elnikety, Nuno O. Duarte, Michael Sammler 等USENIX Security 2019 · 247 次引用
  4. SANCTUARY: ARMing TrustZone with User-space EnclavesFerdinand Brasser, David Gens, Patrick Jauernig, Ahmad-Reza Sadeghi 等NDSS 2019 · 191 次引用
  5. PAC it up: Towards Pointer Integrity using ARM Pointer AuthenticationHans Liljestrand, Thomas Nyman, Kui Wang, Carlos Chinea Perez 等USENIX Security 2019 · 168 次引用

相关 Paper

  1. BULKHEAD: Secure, Scalable, and Efficient Kernel Compartmentalization with PKSYinggang Guo, Zicheng Wang, Weiheng Bai, Qingkai Zeng 等NDSS 2025
  2. EKC: A Portable and Extensible Kernel Compartment for De-Privileging Commodity OSJiaqin Yan, Qiujiang Chen, Shuai Zhou, Yuke Peng 等USENIX Security 2025
  3. SecureCells: A Secure Compartmentalized ArchitectureAtri Bhattacharyya, Florian Hofhammer, Yuanlong Li, Siddharth Gupta 等S&P 2023
  4. EC: Embedded Systems Compartmentalization via Intra-Kernel IsolationArslan Khan, Dongyan Xu, Dave Jing TianS&P 2023
  5. Low-Cost Privilege Separation with Compile Time Compartmentalization for Embedded SystemsArslan Khan, Dongyan Xu, Dave Jing TianS&P 2023
黄昏的海面,两侧是细线勾勒的悬崖