RegVault
RegVault: Hardware Assisted Selective Data Randomization for Operating System Kernels
Proceedings of the 59th ACM/IEEE Design Automation Conference 2022
Paper@inproceedings{xu2022regvault, title = {RegVault: hardware assisted selective data randomization for operating system kernels}, author = {Xu, Jinyan and Lin, Haoran and Yuan, Ziqi and Shen, Wenbo and Zhou, Yajin and Chang, Rui and Wu, Lei and Ren, Kui}, booktitle = {Proceedings of the 59th ACM/IEEE Design Automation Conference}, pages = {715–720}, year = {2022}, doi = {10.1145/3489517.3530549} }
RegVault is a hardware-assisted data randomization scheme for operating system kernels. It keeps selected kernel data encrypted in memory and decrypts it only in registers. Corrupted data then decrypts to garbage values, and leaked data reveals only ciphertext.
Challenges
Kernel attacks often target small pieces of security-critical data, such as return addresses, function pointers, and user credentials. Protecting them runs into two problems:
- Granularity. This data is register-sized and mixed with ordinary data, so page-level (4 KB) protection is too coarse.
- Primitives. Existing data space randomization schemes encode data with XOR masks, which do not survive memory disclosure. AES instructions are designed for bulk data and do not fit register-sized data.
Approach
- Cryptographic register primitives. New RISC-V instructions
cre[x]kandcrd[x]kencrypt and decrypt a register with the tweakable block cipher QARMA. The tweak binds the ciphertext to context such as the storage address, which defeats substitution attacks. A byte-range field lets the same instructions check integrity. - Protected keys. Keys live in dedicated registers. The kernel can write general keys but not read them, and cannot access the master key at all.
- Cryptographic lookaside buffer. A small cache in the crypto-engine holds recent results, so repeated operations skip the cipher.
- Compiler support. Developers annotate sensitive fields with
__randor__rand_integrity, and an LLVM pass instruments their loads and stores automatically. - Interrupt context and register spilling protection. A chain-based scheme encrypts saved interrupt contexts and detects tampering. Sensitive registers stay encrypted when they spill to memory.
Results
RegVault was prototyped on the Rocket core on a Xilinx VC707 FPGA board and applied to Linux kernel 5.8.18.
- Protects six types of kernel data: return addresses, function pointers, kernel keys, user credentials, SELinux state, and page table (PGD) pointers.
- Stopped all eight attacks in penetration tests, including ROP, JOP, privilege escalation, SELinux bypass, and interrupt context corruption.
- Full protection costs 2.6% on UnixBench and 2.5% on LMbench, and close to zero on SPEC CPU2017.
- The crypto-engine completes a QARMA operation in 3 cycles. The crypto-engine and the lookaside buffer each use under 5% of the SoC’s FPGA resources.
Journal Extension
RegVault II extends RegVault to multiple architectures.
RegVault II: Achieving Hardware-Assisted Selective Kernel Data Randomization for Multiple Architectures
ACM Transactions on Computer Systems 2025
Paper@article{guo2025regvault, title = {RegVault II: Achieving Hardware-Assisted Selective Kernel Data Randomization for Multiple Architectures}, author = {Guo, Ruorong and Zhou, Yangye and Xu, Jinyan and Shen, Wenbo and Zhou, Yajin and Chang, Rui}, journal = {ACM Transactions on Computer Systems}, volume = {43}, number = {1-2}, pages = {1–34}, year = {2025}, publisher = {ACM New York, NY} }