Lune

USENIX Security2026Top-tier venue

InstrSem: Automatically and Generically Inferring Semantics of (Undocumented) CPU Instructions

Lorenz Hetterich, Fabian Thomas, Tristan Hornetz, Michael Schwarz

Abstract

Modern CPUs implement complex Instruction Set Architectures (ISAs), yet machine-readable semantics are often incomplete. Worse, many CPUs support undocumented instructions, i.e., bitstrings that execute on hardware but are absent from specifications, leading to potential security vulnerabilities. In this paper, we present InstrSem, an ISA-agnostic, modular, fully automated approach to infer instruction semantics from execution behavior alone and provide semantics that are understandable by both, humans and machines. Starting from a raw encoding, InstrSem executes it under systematically varied architectural states and synthesizes compact mathematical functions that explain every changed state component. By mutating encoding bits and correlating induced behavioral changes with bit positions, InstrSem then generalizes from a single encoding to a full instruction, recovering register and immediate fields. In contrast to prior work focusing on a single ISA, InstrSem is generic. It requires only a lightweight ISA model and a per-architecture user-space runner and supports fixed- and variable-length encodings (RISC and CISC), memory accesses, and conditional behavior. We evaluate InstrSem on RV64I, AArch64, and LA64, and additionally showcase CISC applicability on a Logitech macro language and partial x86-64. InstrSem automatically recovers correct semantics for over 97.81 % of the RV64I base instruction set, and 136 instructions covering 1 009 055 744 instruction encodings within 77 h for the LA64 instruction set. InstrSem discovers undocumented vector instructions, inconsistencies between QEMU and Loongson hardware, and instructions that crash QEMU. InstrSem enables scalable recovery of instruction semantics, substantially automating reverse engineering across commodity and niche targets and strengthening the foundations for emulation, verification, and security analysis. With minimal requirements to support new architectures, its modular design, and human-readable output, InstrSem can aid future security analysis.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • LVI: Hijacking Transient Execution through Microarchitectural Load Value Injection cites Spectre Attacks: Exploiting Speculative Execution
  • LVI: Hijacking Transient Execution through Microarchitectural Load Value Injection cites Meltdown: Reading Kernel Memory from User Space
  • LVI: Hijacking Transient Execution through Microarchitectural Load Value Injection cites Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order Execution
  • LVI: Hijacking Transient Execution through Microarchitectural Load Value Injection cites Fallout: Leaking Data on Meltdown-resistant CPUs
  • Meltdown: Reading Kernel Memory from User Space cites Spectre Attacks: Exploiting Speculative Execution
  • Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order Execution cites Spectre Attacks: Exploiting Speculative Execution
  • Fallout: Leaking Data on Meltdown-resistant CPUs cites Spectre Attacks: Exploiting Speculative Execution
  • Fallout: Leaking Data on Meltdown-resistant CPUs cites Meltdown: Reading Kernel Memory from User Space
  • Fallout: Leaking Data on Meltdown-resistant CPUs cites Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order Execution
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on10

  1. Spectre Attacks: Exploiting Speculative ExecutionPaul Kocher, Jann Horn, Anders Fogh, Daniel Genkin et al.S&P 2019 · 2,435 citations
  2. Meltdown: Reading Kernel Memory from User SpaceMoritz Lipp, Michael Schwarz, Daniel Gruss, Thomas Prescher et al.USENIX Security 2018 · 1,456 citations
  3. Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order ExecutionJo Van Bulck, Marina Minkin, Ofir Weisse, Daniel Genkin et al.USENIX Security 2018 · 1,175 citations
  4. Fallout: Leaking Data on Meltdown-resistant CPUsClaudio Canella, Daniel Genkin, Lukas Giner, Daniel Gruss et al.CCS 2019 · 289 citations
  5. LVI: Hijacking Transient Execution through Microarchitectural Load Value InjectionJo Van Bulck, Daniel Moghimi, Michael Schwarz, Moritz Lipp et al.S&P 2020 · 275 citations

Related papers

  1. libLISA: Instruction Discovery and Analysis on x86-64Jos Craaijo, Freek Verbeek, Binoy RavindranOOPSLA 2024 · 1 citation
  2. iDEV: exploring and exploiting semantic deviations in ARM instruction processingShisong Qin, Chao Zhang, Kaixiang Chen, Zheming LiISSTA 2021 · 7 citations
  3. D-ARM: Disassembling ARM Binaries by Lightweight Superset Instruction Interpretation and Graph ModelingYapeng Ye, Zhuo Zhang, Qingkai Shi, Yousra Aafer et al.S&P 2023
  4. ArchSem: Reusable Rigorous Semantics of Relaxed ArchitecturesThibaut Pérami, Thomas Bauereiss, Brian Campbell, Zongyuan Liu et al.POPL 2026 · 1 citation
  5. Semantics-Guided Control-Flow Reconstruction for Firmware Binaries via Static AnalysisFengjuan Gao, Qingjie Zhu, Yi Zhang, Yu Wang et al.FSE 2026
Dusk over the sea between two cliffs drawn in fine vertical lines