arXiv:2609.02048cs.CRSep 2026

Manuscript Offprint

arXiv:2609.02048

Type-Directed, Secure-by-Construction Enclave Partitioning for LLVM

Wesley B. Nuzzo, Samuel Dodson, Benjamin Houle, Tarakaram Gollamudi, Anitha Gollamudi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Wesley B Nuzzo

Wesley_Nuzzo@student.uml.edu

University of Massachusetts Lowell

USA

Samuel Dodson

Samuel_Dodson@student.uml.edu

University of Massachusetts Lowell

USA

Benjamin Houle

benjamin_houle@student.uml.edu

University of Massachusetts Lowell

USA

Tarakaram Gollamudi

tarakaram_gollamudi@uml.edu

University of Massachusetts Lowell

USA

Anitha Gollamudi

anitha_gollamudi@uml.edu

University of Massachusetts Lowell

USA

Abstract

Trusted Execution Environments (TEEs) provide hardware-supported isolation through enclaves that protect code and data independently of software abstractions. However, TEEs alone cannot enforce information flow security. This problem is further aggravated in LLVM-like low-level languages that allow unrestricted pointer manipulation and unstructured control flow. Moreover, using TEEs effectively typically requires manually partitioning applications into enclave and non-enclave components, a process that is labor-intensive, error-prone, and lacks fine-grained control.

We address these challenges with a three-step approach. First, we formalize SIR, an enclave-oblivious calculus based on LLVM IR, equipped with a novel permissive type system that enforces security against low-level attackers. To obtain meaningful guarantees, SIR combines information-flow control with security-aware coarse-grained memory safety. Second, we extend SIR to SIREN, an enclave-aware calculus that enforces noninterference against stronger attackers capable of observing arbitrary non-enclave memory. Third, we develop a type-driven, type-preserving compilation from SIR to SIREN that automatically produces secure enclave-aware programs, eliminating the need for manual partitioning while providing fine-grained control over host-enclave boundaries.

We implement and evaluate SPLITR on thirteen micro-benchmarks and real-world workloads, including applications from SGXGauge, on Intel SGX hardware. SPLITR scales to OpenSSL (425,953 LLVM IR instructions) and supports multiple objectives that expose trade-offs among enclave TCB size, host-enclave transitions, and boundary data movement; for OpenSSL, optimizing for transitions reduces them from 393 to 187. Runtime overhead is dominated by fixed enclave costs for short-running workloads, whereas long-running applications better amortize these costs and approach native performance.

1 Introduction

Trusted Execution Environments (TEEs), such as Intel SGX [19] and ARM TrustZone [3], provide strong hardware-based isolation against privileged attackers, including a compromised operating system. By executing sensitive code inside secure enclaves, TEEs protect code and data even when the kernel is malicious. For example, an authentication application may store secret credentials (e.g., passwords) within an enclave, protecting them from the operating system.

Figure

Figure 1. Tracking implicit flows in LLVM using a standard IFC type system. The program gets rejected since there are public side-effect in the private block merge.

LLVM [24] is a widely used low-level intermediate language with unstructured control flow (Figure 1) and arbitrary pointer arithmetic. Our goal is to enforce security in LLVM using TEEs while enabling flexible enclave partitioning. Given a security specification identifying sensitive data, the system should automatically place the corresponding code and data inside enclaves with formal security guarantees. By targeting LLVM IR, our approach aims to protect any application that compiles to LLVM, enabling broad deployment.

Unfortunately, TEEs cannot prevent a vulnerable application from leaking its own secrets; thus, placing an entire application inside an enclave does not guarantee confidentiality. While Gollamudi and Chong [14] propose a formal framework for enclave-based information-flow security, its guarantees do not extend to LLVM-like low-level languages, which are memory-unsafe (e.g., pointer arithmetic and gep-induced type confusion) and feature unstructured control flow. Enforcing security in this setting therefore introduces additional challenges.

Challenge 1. IFC for Low-level Languages. Enforcing IFC in LLVM requires tracking implicit flows from complex control flow. A branch on secret data can taint all successors, leading standard IFC systems to reject programs with public effects—an overly restrictive outcome (Figure 1). More permissive approaches allow taint downgrading at join points, but prior work [7, 8] does not integrate cleanly with static IFC type system and often requires declassification to avoid over-tainting.

Moreover, IFC does not address memory errors such as buffer overflows, which can expose secrets via public pointers. Thus, meaningful security requires preventing memory violations across security boundaries.

Challenge 2. Using TEEs is challenging. TEE constraints require partitioning applications into enclave and host components (e.g., SGX disallows system calls inside enclaves). LibOS-based approaches [37] increase the TCB and attack surface [16]. Manual partitioning is costly and error-prone [17, 20]. Several frameworks have explored automated application partitioning [10, 12, 14, 22, 32, 34] for high-level languages, but none target LLVM IR-like low-level languages. Moreover, systems designed for real-world applications [10, 12, 22, 32, 34] do not provide formal security guarantees, whereas Gollamudi and Chong [14] offers strong formal guarantees but does not evaluate the approach on real-world applications.

Challenge 3. Exploring Partitioning Trade-offs. Frequent host-enclave transitions incur significant overhead, making naive partitioning inefficient. Most prior work, except Gollamudi and Chong [14], assumes a fixed objective and overlooks the security-performance trade-offs inherent in practical partitioning. While Gollamudi and Chong [14] proposes a proof-of-concept, their evaluation neither executes the partitioned programs to analyze performance-security trade-offs nor demonstrates the approach on real-world applications.

References (14)