System and method for delegating restricted operations from trusted execution environments

The introduction of an enclave-aware Application Binary Interface during compilation addresses the challenge of broad TEE adoption by enabling traditional applications to securely interact with trusted execution environments, enhancing security and interoperability.

US20260377522A1Pending Publication Date: 2026-11-26APPLIED ENCLAVES LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
US19/731224
Authority / Receiving Office
US · United States
Patent Type
Applications(United States)
Current Assignee / Owner
Priority Date
2024-03-15
Filing Date
2026-07-06
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

Existing computing platforms face challenges in enabling broad adoption of trusted execution environments (TEEs) due to the lack of enclave-aware toolchains, such as compilers, loaders, and runtimes, which limits the ability to protect code and data from unauthorized access and interference across execution environments.

Method used

An enclave-aware Application Binary Interface (eABI) is introduced during compilation to translate generic source code into executables with enclave-aware metadata and instructions, allowing controlled interaction between TEEs and common memory, and is supported by an enclave-aware compiler, loader, and runtime.

Benefits of technology

This approach enables traditional applications to participate in trusted execution environments without requiring SDK-aware source code, enhancing security by ensuring interoperability and protecting data across diverse execution environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US20260377522A1-D00000_ABST
    Figure US20260377522A1-D00000_ABST
Patent Text Reader

Abstract

Restricted operations unavailable inside a trusted execution environment (TEE) are delegated to a common memory executable enabling practical sub-process isolation. When an enclave-aware executable needs to run a restricted instruction, it calls an executable running in common memory using an enclave-aware application binary interface (eABI)-defined function call. The eABI-common executable reconstructs the call using an eABI calling convention that copies arguments across TEE boundaries, invokes the restricted instruction, system call, standard library service, or operating system interface outside the TEE, and forms a result to return. Data inside the TEE that is not represented by an argument or otherwise selected for transfer remains inaccessible to the common executable. An enclave-aware compiler may generate the protected caller, unprotected service code, eABI metadata, a controlled entry point, request logic, and return logic from generic source code that omits enclave-specific interfaces, lifecycle calls, transition wrappers, and explicit marshaling.
Need to check novelty before this filing date? Find Prior Art

Description

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application is a continuation-in-part of U.S. patent application Ser. No. 19 / 029,871, filed Jan. 17, 2025, entitled “SYSTEM AND METHOD FOR RUNNING ENCLAVE-AWARE EXECUTABLES” (the “'871 application”), which claims the benefit of U.S. Provisional Patent Application Ser. No. 63 / 565,907, filed Mar. 15, 2024, entitled “METHOD TO PARTITION MULTIPLE EXECUTABLES INTO INDIVIDUAL ENCLAVES IN A COMMON PROCESS SPACE” (the “'907 provisional”). This application claims the benefit of the '871 application under 35 U.S.C. § 120 and 37 C.F.R. § 1.78 and, through the '871 application, claims the benefit of the '907 provisional under 35 U.S.C. § 119 (e) and 37 C.F.R. § 1.78. The entire disclosures of the '871 application and the '907 provisional, including the specifications, claims, abstracts, and drawings thereof, are incorporated herein by reference.

[0002] This application is also a continuation-in-part of International Application No. PCT / US2025 / 012106, filed Jan. 17, 2025, entitled “SYSTEM AND METHOD FOR ENCLAVE-AWARE ARCHITECTURE,” which designates the United States (the “PCT application”). This application claims the benefit of the PCT application under 35 U.S.C. §§ 120 and 365(c) and 37 C.F.R. § 1.78. The entire disclosure of the PCT application, including its specification, claims, abstract, and drawings, is incorporated herein by reference.

[0003] Applicant certifies that International Application No. PCT / US2025 / 012106 has not been withdrawn and has not been considered withdrawn, either generally or as to the United States, before the filing date of the present application.STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

[0004] Pursuant to a determination under 37 C.F.R. § 501.6(a)(2), title to the invention was left with the inventor, subject to reservation to the United States Government of a nonexclusive, irrevocable, royalty-free license in the invention with power to grant licenses for all governmental purposes. Any assignment of the invention is subject to the foregoing Government license.THE NAMES OF THE PARTIES TO A JOINT RESEARCH AGREEMENT

[0005] Not applicable. No joint research agreement within the meaning of 35 U.S.C. § 100(h) and 37 C.F.R. § 1.9(e) applies to the claimed invention. Applicant is not relying on 35 U.S.C. § 102(c), 37 C.F.R. § 1.71(g), or 37 C.F.R. § 1.104(c)(4)(ii) to except any subject matter from prior art on the basis of a joint research agreement.STATEMENT REGARDING PRIOR DISCLOSURES BY THE INVENTOR OR A JOINT INVENTOR

[0006] Without conceding that any disclosure identified in this paragraph is prior art, Applicant identifies the following disclosures as inventor-originated disclosures under 37 C.F.R. § 1.77 (b)(6) and for purposes of the exceptions set forth in 35 U.S.C. § 102 (b). The disclosures identified in this paragraph were made by Mark Nelson, the inventor of the present application, or by another who obtained the subject matter disclosed directly or indirectly from Mark Nelson. The identified disclosures include: U.S. Provisional Patent Application Ser. No. 63 / 565,907, filed Mar. 15, 2024, entitled “METHOD TO PARTITION MULTIPLE EXECUTABLES INTO INDIVIDUAL ENCLAVES IN A COMMON PROCESS SPACE”; U.S. patent application Ser. No. 19 / 029,332, filed Jan. 17, 2025, entitled “SYSTEM AND METHOD FOR COMPILING ENCLAVE-AWARE EXECUTABLES”; U.S. patent application Ser. No. 19 / 029,871, filed Jan. 17, 2025, entitled “SYSTEM AND METHOD FOR RUNNING ENCLAVE-AWARE EXECUTABLES”; U.S. Pat. No. 12,657,287, issued Jun. 16, 2026 from U.S. patent application Ser. No. 19 / 029,931, filed Jan. 17, 2025, entitled “SYSTEM AND METHOD FOR LOADING ENCLAVE-AWARE EXECUTABLES”; International Application No. PCT / US2025 / 012106, filed Jan. 17, 2025, entitled “SYSTEM AND METHOD FOR ENCLAVE-AWARE ARCHITECTURE”; and any U.S., WIPO, or foreign patent publication corresponding to any of the foregoing.

[0007] Applied Enclaves LLC, a limited liability company founded by Mark Nelson in November 2025, is the assignee of the present application, or the entity to which the inventor is under an obligation to assign the present application. In addition, to the extent any disclosure identified in paragraph is considered subject matter disclosed in a U.S. patent, U.S. patent application publication, or WIPO published application under 35 U.S.C. § 102(a)(2), the claimed invention of the present application and the subject matter disclosed in the identified references were, not later than the effective filing date of the claimed invention, commonly owned by, or subject to an obligation of assignment to, Applied Enclaves LLC. Applicant intends that the identified disclosures be treated under all applicable exceptions to prior art, including 35 U.S.C. §§ 102(b)(1)(A), 102(b)(1)(B), 102(b)(2)(A), 102(b)(2)(B), and 102(b)(2)(C), to the extent the requirements of those exceptions are satisfied.BACKGROUND OF THE INVENTIONTechnical Field

[0008] The present disclosure relates generally to computer security, trusted computation, and trusted execution environments, and more particularly to enclaves, application binary interfaces (ABIs), loaded executables, compiler-generated executable files from generic source code, loader operations, runtime-mediated control transfer or data exchange, metadata, policy and trust mechanisms for controlling code execution, application of data security modes for protecting function arguments and data passed between different execution environments, and protection of code or data across usermode, kernelmode, common memory, and trusted execution environments.Background

[0009] Modern computing platforms may execute applications, libraries, runtime systems, operating system services, and other executable components that transfer control or exchange data through conventional binary interfaces and calling conventions. These executable components may interact without authenticated provenance, tamper resistance, private data, or policy-defined constraints governing control transfer or data exchange between components. As a result, executables in a common execution environment may be unable to distinguish trusted executables from untrusted executables, prevent one executable from interfering with another, or protect entry points, function arguments, or return values from other executables operating within the same process, kernel, or computing environment. Although trusted execution environment hardware and software may permit developers to construct customized isolated execution systems using specialized software development kits (SDKs), technical challenges remain in enabling broad adoption of enclave-aware toolchains, including compilers, loaders, and runtimes. This disclosure introduces an enclave-aware application binary interface configured to permit a compiler to translate generic source code into executables having metadata, processor instructions, and binary-level semantics configured to address provenance, tamper resistance, controlled interoperability, data protection, and policy-governed control transfer, or data exchange across execution environment boundaries.

[0010] Trusted execution environments (TEEs) or enclaves may protect selected code or data through isolated execution, integrity or confidentiality protections, controlled entry and exit, attestation, key establishment, restricted-instruction enforcement, or combinations thereof. TEEs or enclaves may be implemented using specialized processor instructions, memory managers, virtualization, firmware, coprocessors, hypervisors, or dedicated hardware.

[0011] One or more TEEs may coexist with code executing outside the TEEs within a common virtual address space, process, or kernel. “Calling conventions” define how control is transferred, data is exchanged, or symbols are accessed across these execution boundaries.

[0012] One type of TEE may include a memory enclave that provides a protected execution environment for code executing on a computing platform that also executes code outside the memory enclave. In some embodiments, instructions executing outside a trusted execution environment may be restricted from accessing code, data, metadata, keys, or other protected content maintained within the trusted execution environment, while instructions executing inside the trusted execution environment may access selected data inside the trusted execution environment, outside the trusted execution environment, or combinations thereof.

[0013] A TEE may also support measurement, launch validation, controlled transitions, attestation, key derivation, sealing, protected communication, debug modes, or restricted-instruction enforcement. Control transfers into or out of a TEE may be limited to designated entry or exit points. There remains a need for an enclave-aware calling convention.

[0014] A trusted execution environment developed by Intel® is called Intel® Software Guard Extensions (SGX) enclave technology. Other trusted execution technologies include AMD® Secure Encrypted Virtualization (SEV) confidential computing technology, ARM® TrustZone® isolation technology, Apple® Secure Enclave® security module, RISC-V® Keystone Enclave open standard technology, Qualcomm® Secure Execution Environment (QSEE) trusted execution environment, or Huawei® Trusted Execution Environment.

[0015] Some enclave implementations use digital signatures or measurements that establish integrity but do not, by themselves, establish a certificate chain-based publisher, provenance, or permitted-use relationship. Additional trust information may therefore be evaluated when loading, initializing, or authorizing an executable.

[0016] In some TEE lifecycle models, code and data are constructed or loaded before the TEE is initialized. Initialization may verify expected contents or configuration and transition the TEE to an execution-ready state in which protected code and data are isolated from unauthorized access.

[0017] Intel® Software Guard Extensions (SGX) enclaves may be used by applications specifically programmed with SDK-aware source code that uses an Application Programming Interface (API) or Software Development Kit (SDK). This may require substantial development, new tooling, and expert knowledge of the SGX SDK.

[0018] Trusted execution environments or enclaves may also be used in a Library OS framework such as Gramine™ (formerly Graphene), a Library Operating System (LibOS) framework in which applications may be generally unaware of enclaves, but a large portion of the system may be loaded into a single enclave. This potentially increases the volume of code within a single trusted computing base, including code from multiple anonymous publishers, thereby rendering the enclave a coarse-grained trust boundary rather than an executable-specific or publisher-specific trust boundary. A LibOS framework does not have policy-governed loading or control transfer, nor does it protect arguments used by external calls between executables.

[0019] Memory isolation may be applied at system, process, or sub-process scope. Sub-process isolation may partition code or data within a usermode process or common virtual address space, including by placing separate executable components in separate TEEs while permitting controlled interoperability among them.

[0020] A TEE may also be associated with a kernel, operating system service, hypervisor, or firmware component to isolate selected privileged functionality while permitting controlled interoperability with usermode processes, common memory, or other TEEs.

[0021] Computer programs may represent a substantial investment in development resources, a return on which may be realized only if the programs are believed to be both useful and secure by end users. Sub-process isolation may use TEEs to help ensure that programs are utilized in their intended manner by providing confidentiality and integrity guarantees to end users. Retrofitting support for TEEs after a program has already been developed may be time consuming and may create substantial risk. Furthermore, it may be difficult to add support for TEEs to a software library without access to the source code, design documents, or permission to modify it.

[0022] The Application Binary Interface (ABI) defines the low-level interface between compiled executables and the operating system or between a traditional main executable and a traditional library executable. Unlike an Application Programming Interface (API), which specifies how source code components interact, an ABI governs how binary executables interoperate, including details like calling conventions, datatype layouts, register usage, how external symbols are accessed, system call mechanisms, and return values. ABIs enable compatibility between compiled code (executables) and the underlying runtime environment, allowing software to interoperate on a given platform.

[0023] For example, in the context of a C executable, the ABI (calling conventions) may specify how function arguments are passed (e.g., in registers or on the stack), how return values are handled, and how memory alignment is maintained. Traditional ABIs, such as the System V AMD64 ABI for Linux® open source operating system or the Microsoft® x64 Calling Convention for Windows® operating system, play a role in enabling interoperability between different compilers, libraries, and operating systems. Compilers must generate executables that conform to these interoperability standards. By adhering to these standards, developers and toolchain providers ensure that software may execute reliably across diverse environments. However, traditional ABIs may expect all executables to be in common memory. Therefore, traditional ABIs may not be aware of enclaves.

[0024] Compilers are essential tools in software development, converting text-based generic source code like C, C++, Go, or Rust into traditional executables. The processor instructions and data are placed into sections. At the end of the compilation process, a new traditional executable file may be created by writing out metadata, headers, and the contents of each section, which are then arranged into an executable file. This executable file may be copied to other computers and may be run at will by non-programmers. When a user is ready to run the executable file, another program called a “loader” may analyze the executable file, identify dependent “shared libraries” and “runtime” software, and load selected portions into memory. The loader may carefully load portions of all these files into a “common virtual address space”. Finally, the loader may create a “thread of execution” and may set the CPU's instruction pointer to an entry point in a main executable.

[0025] The compiler toolchain for the C language may consist of several stages, including preprocessing, compilation, assembly, and linking. The Linux® open source operating system includes compilation toolchains such as GCC (GNU Compiler Collection) or Clang® compiler frontend (LLVM® Project). The Microsoft® Windows® operating system compilation toolchain includes Microsoft® Visual C++® or MinGW® (Minimalist GNU for Windows) compiler and runtime environment. Compilation processing includes lexical analysis, syntax analysis, semantic analysis, optimization, and code generation.

[0026] Compilation outputs may include object files or executable files targeted to a processor architecture or ABI and may be published or distributed before being loaded for execution.

[0027] An executable file may organize code, data, and metadata into sections or segments. Text sections may contain processor instructions, data sections may contain data, and some informational sections need not be loaded into memory.

[0028] After an executable is compiled, it may use traditional program loaders and the runtime environment to execute. The traditional loader may be responsible for loading the executable into memory, recursively resolving shared library dependencies (dependent executables), and setting up the initial execution environment, including stack, heap, and program arguments. In the Linux® open source operating system, the loader may be the dynamic linker / loader (ld.so), which may be invoked by the kernel. In the Microsoft® Windows® operating system, the loader may be a component of the Windows® Application Programming Interface (API).

[0029] The runtime environment provides essential services such as dynamic memory allocation, standard I / O handling, and signal processing, often implemented by libraries like glibc on Linux® or the Microsoft® C Runtime Library (msvcrt.dll) dynamic link runtime library on Microsoft® Windows®. This cohesive ecosystem ensures that a compiled executable may reliably run across a large and diverse user base.

[0030] The technical burden of compiling, loading, and operating enclaves may limit an end user's ability to maintain security protections across their computing environment due to lack of tools such as compilers, loaders, and runtimes that support enclaves. The reliance on traditional process isolation methods and the limited availability of systems configured to support sub-process isolation with generic source code may leave code and data susceptible to breaches, especially when supervisory systems like operating systems or hypervisors are compromised. Furthermore, the limited ability to verify the trustworthiness of third-party libraries may compound these security risks, making it difficult to ensure the integrity and confidentiality of data. Broader adoption of trusted execution environments requires a reevaluation of the relationship between executables and libraries, along with a redefined ABI that supports stricter security protocols. Making TEEs ubiquitous may mitigate one or more of these issues. An enclave-aware ABI, enclave-aware compiler, and enclave-aware loader may provide commercially deployable toolchain support for translating generic source code into enclave-aware executables that participate in trusted execution environments while preserving interoperability with existing software ecosystems.DESCRIPTION OF RELATED ART

[0031] As shown in FIGS. 11 and 14, traditional software may be written in generic source code 118 (FIGS. 8-9) and compiled by a traditional compiler 330 (FIG. 10) into traditional executable files 234 that are executed within a process using a traditional Application Binary Interface (ABI) 342. The traditional ABI governs function invocation, symbol resolution, parameter passing, and execution semantics between executable components such as applications and libraries.

[0032] A person having ordinary skill in the art (“PHOSITA”) would understand that traditional executables 334 may assume a single common virtual address space 220 (FIGS. 11, 14, and 21) within a usermode process 150 in which executables, including libraries and application code, execute with shared visibility, shared addressing, and conventional trust relationships. In such environments, compilers translate generic source code into executables without regard to enclave-based isolation technologies or trusted execution environments.

[0033] A PHOSITA would further understand that existing Trusted Execution Environment (TEE) 326 technologies, including Intel® Software Guard Extensions (SGX), ARM® TrustZone®, AMD® Secure Encrypted Virtualization (SEV), and other confidential computing technologies, have historically used development models in which programmers write SDK-aware source code 332 (FIGS. 24A-C) and compile the SDK-aware source code using specialized Software Development Kits (SDKs) (FIGS. 18, 20, and 25). In such systems, enclave semantics are introduced by the programmer through the use of specialized APIs, enclave configuration artifacts, and enclave-specific toolchains rather than by the compiler itself.

[0034] Under such approaches, a developer typically writes SDK-aware source code that explicitly defines enclave entry points, enclave calls, and enclave interfaces using SDK-specific constructs. For example, FIG. 24A contains SDK-specific Enclave Definition Language (EDL) source code explicitly defining a function called “count” that runs inside an enclave and an unprotected function called “ocall_print” that runs outside an enclave. FIG. 24B contains SDK-specific source code explicitly defining the properties of an enclave.

[0035] A PHOSITA would further recognize that SDK-specific source code containing the function calls to create and destroy an enclave (FIG. 24C) is not generic source code. A PHOSITA would recognize FIGS. 24A-C as SDK-aware source code because the source code expressly includes SDK-specific APIs, enclave definition artifacts, or enclave lifecycle calls.

[0036] Furthermore, the resulting SDK-specific build process often produces separate binaries or enclave artifacts that must be managed independently of a single traditional application executable. In contrast, an enclave-aware compiler 122 may translate generic source code into a single enclave-aware executable 126 having enclave-aware metadata, protected sections 156, enclave-aware instructions 128, or enclave-aware binary-level semantics.

[0037] A PHOSITA would recognize that SDK-aware source code 332 may impose a substantial burden on developers and may limit the ability of conventional software written in generic source code 118 to easily adopt enclave-based execution.BRIEF SUMMARY OF THE INVENTION

[0038] The present disclosure describes an enclave-aware architecture in which enclave semantics may be introduced during compilation rather than being expressed through SDK-aware source code by the programmer.

[0039] The present disclosure also describes an enclave-aware Application Binary Interface (eABI) 114 that extends or modifies a traditional ABI 342 to support controlled interaction between code executing in Trusted Execution Environments (TEEs) 326 such as enclaves 104 and code executing in common memory 166 (FIGS. 49A-B). Unlike a traditional ABI, which may assume all components run in a single common virtual address space 220, an eABI may define calling conventions, symbol resolution rules, parameter passing mechanisms, and execution semantics that operate across TEEs or enclaves. The eABI may provide a structured binary contract governing interoperability, data exchange, control transfer, provenance, policy enforcement, and trusted execution semantics in an enclave-aware architecture.

[0040] An enclave-aware architecture may use generic source code 118 (FIGS. 8-9) written in conventional programming languages such as C, C++, or similar languages. The generic source code may be compiled by an enclave-aware compiler 122 that produces enclave-aware executables 126 configured to participate in enclave-aware runtime environments (FIG. 31).

[0041] The present disclosure describes “eABI-aware” artifacts that utilize the eABI for interoperating between enclave-aware code that may be running in common memory or in a TEE such as an enclave (FIGS. 6, 16, and 31). The present disclosure further describes “enclave-aware” artifacts that utilize the eABI for interoperating between TEEs. For example, an enclave-aware compiler 122 may produce an eABI-aware executable (called an “eABI-common executable”208) that may run in common memory but can interoperate with a loaded enclave-aware executable 268 running in an enclave. Furthermore, an enclave-aware compiler may also produce an enclave-aware executable that may run in an enclave, include protected sections for placement in a TEE, include unprotected sections for placement in common memory, include metadata for use by an enclave-aware loader, or include certificates 168 for provenance or governed launch.

[0042] The resulting executables may be interpreted by other components of the architecture, including an enclave-aware loader 146 (FIGS. 15-17 and 37) and an eABI-aware runtime 180 (FIGS. 34 and 40), which cooperate to instantiate enclaves and facilitate execution across TEEs.

[0043] In this architecture, the enclave-aware compiler generates executable structures (FIGS. 15, 31, and 48) that indicate which portions of an executable are intended to execute within an enclave (protected sections 156) and which portions are intended to execute within common memory (unprotected sections 154). The compiler also generates interoperability mechanisms such as eABI metadata 246, notes 212, symbol information, candidate data security modes 372, or PKI certificates 168 that allow eABI-aware executables 112 to interact according to the eABI.

[0044] As a result, enclave semantics may be introduced by an enclave-aware compiler 122 (FIG. 31) rather than by the programmer, enabling ordinary software to participate in enclave-based execution environments without requiring source-level enclave constructs.

[0045] A PHOSITA would recognize that the architecture described herein enables enclave participation to be introduced during compilation without requiring source-level enclave constructs. Generic source code may be compiled by an enclave-aware compiler 122 that generates executable structures enabling enclave execution, control transfer, or data exchange between TEEs.

[0046] As a result, traditional applications may be compiled into enclave-aware executables capable of participating in trusted execution environments without requiring developers to write SDK-aware source code 332 or rely on specialized SDK workflows. The architecture may thereby support commercial adoption by allowing generic source code 118 to be extended with enclave-aware behavior while preserving compatibility with existing software ecosystems.

[0047] In certain embodiments, the present disclosure provides systems, methods, and non-transitory computer-readable media for enhancing security in computing environments by enabling generic source code to be translated into executable files that participate in trusted execution environments through an enclave-aware compiler, an enclave-aware loader, an eABI-aware runtime, and an enclave-aware Application Binary Interface (eABI). The disclosed technology may support executable-level or sub-process isolation using the eABI to permit executable components to interoperate across common memory, trusted execution environments, enclaves, kernel-level execution environments, or combinations thereof.

[0048] The eABI (FIG. 2) may define calling conventions, symbol resolution semantics, note formation semantics (FIG. 50), routing semantics (FIG. 33), dispatch semantics, return semantics, data transfer semantics, restricted instruction call semantics, validation semantics, controlled entry point semantics, data security mode semantics (FIG. 39), or combinations thereof.

[0049] In certain embodiments, an enclave-aware compiler may translate generic source code into an enclave-aware executable file or an eABI-aware executable file (FIGS. 22 and 31). The generic source code (FIGS. 8-9) may be written without requiring SDK-aware source code (FIGS. 24A-C), enclave-specific interface definitions, explicit enclave lifecycle calls, or specialized SDK workflows (FIG. 18). The enclave-aware compiler may generate processor instructions, enclave-aware instructions, protected sections, unprotected sections, metadata, eABI metadata, symbol information, note formation semantics, data security mode information, certificate information, or combinations thereof.

[0050] In certain embodiments, an enclave-aware executable may include one or more protected sections configured for placement in a trusted execution environment and one or more unprotected sections configured for placement in common memory (FIGS. 15 and 31). The protected sections may include protected text sections, protected data sections, metadata, published symbol information, external symbol dependency information, cryptographic information, or combinations thereof. The unprotected sections may include code or data configured to execute outside the trusted execution environment, including code configured to perform restricted instructions 204 or common memory services according to the eABI.

[0051] In certain embodiments, an enclave-aware loader may analyze an enclave-aware executable, eABI-aware executable, eABI-common executable, certificate information, target execution environment information 266, or combinations thereof. The enclave-aware loader may create, instantiate, load, map, provision, initialize, or otherwise prepare one or more trusted execution environments, and may load protected portions of executable files (FIGS. 15, 16, and 37) into the trusted execution environments while loading unprotected portions into common memory.

[0052] In certain embodiments, an eABI-aware runtime may mediate, facilitate, route, dispatch, broker, or otherwise support control transfer or data exchange between loaded executables according to the eABI (FIGS. 32 and 36).

[0053] In certain embodiments, a note may be formed, routed, dispatched, processed, returned, encrypted, decrypted, authenticated, validated, or otherwise handled according to the eABI (FIGS. 32 and 36). The note may include a routable envelope and a protected payload (FIG. 50). The routable envelope may include routing information usable by an eABI-aware runtime, operating system, kernel service interface, common memory executable, or other routing component, while the protected payload may include argument information, referenced-data information, return information, symbol information, cryptographic support information, or other data protected from interpretation outside an authorized execution environment.

[0054] In certain embodiments, a data security mode (FIG. 39) may govern how control transfer, data exchange, note formation, note routing, note dispatch, symbol access, argument passing, return value handling, or restricted instruction execution is performed (FIGS. 44-45). The data security mode may include a plaintext mode, encryption mode, validation mode, secure mode, max mode, encryption-with-validation mode, or combinations thereof. A selected data security mode may be determined, changed, negotiated, constrained, or enforced based on compiler-generated metadata, executable policy, runtime policy, system policy, user policy, trust status, symbol-level requirements, performance conditions, security requirements, or combinations thereof. An enclave-aware compiler 122 may generate candidate data security modes 372 associated with published symbols, external symbol dependencies, note formation semantics, control transfer semantics, data exchange semantics, or combinations thereof according to the eABI (FIG. 48).

[0055] In certain embodiments, certificate-based trust mechanisms may be used to control loading, initialization, execution, external symbol dependency resolution, eABI participation, or data security mode availability (FIG. 53). An enclave-aware executable, eABI-aware executable, protected section, enclave-compatible cryptographic key, or trusted execution environment may be associated with a certificate, digital signature, certificate chain, public key infrastructure, trusted root, production mode, revocation information, attestation information, provenance information, or combinations thereof. An enclave-aware loader, eABI-aware runtime, operating system, hypervisor, firmware component, kernel component, or other execution component may evaluate such information before permitting one or more protected operations.

[0056] In certain embodiments, the disclosed technology may be applied to kernel-level execution environments. A trusted execution environment may be instantiated within, loaded into, associated with, or made accessible to a kernel, kernel module, operating system service, device driver, hypervisor, firmware component, bootloader, privileged service, secure monitor, or other privileged execution environment (FIG. 54). An eABI may define binary-level semantics for control transfer or data exchange involving a kernel-resident trusted execution environment, including requests to access, modify, validate, or use an isolated kernel resource 412 through a kernel service interface 414.

[0057] In certain embodiments, methods are provided for compiling, loading, initializing, validating, executing, routing, dispatching, or mediating executable components according to the eABI (FIGS. 49A-B). In certain embodiments, a non-transitory computer-readable medium may store instructions that, when executed by one or more processors, cause the processors, loaders, runtimes, loaded executables, trusted execution environments, or combinations thereof to perform one or more operations described herein. Further areas of applicability will become apparent from the description provided herein, and the description and specific examples in this summary are intended for purposes of illustration only and are not intended to limit the scope of the present disclosure.BRIEF DESCRIPTION OF THE DRAWINGS

[0058] FIG. 35 is selected as the representative figure for publication.

[0059] The drawings described herein are illustrative and are not intended to limit the scope of the present disclosure. Unless expressly stated otherwise, any component, flow, field, table entry, relationship, or ordering shown in a drawing may be used independently or in combination with other disclosed components, flows, fields, table entries, relationships, or orderings.

[0060] Reference numbers used in the drawings are intended to identify corresponding structures, operations, data, metadata, or relationships described in the specification. A figure may omit details of another figure for clarity, and a figure that illustrates a particular embodiment does not require the same arrangement in every embodiment.

[0061] FIG. 1 schematically illustrates an enclave-aware Application Binary Interface (eABI) 114 in relation to toolchain, runtime, data-security, governed launch, restricted operation, and kernel-resident trusted execution environment features.

[0062] FIG. 2 is an ontology demonstrating possible relationships between an Application Binary Interface (ABI) and an enclave-aware application binary interface (eABI) 114.

[0063] FIG. 3 is a comparative table illustrating different partitioning scopes for isolation within a computing system. The table introduces a new term “Sub-process isolation” and places the term in the context of existing terminology.

[0064] FIG. 4 schematically contrasts prior art compiler treatment with compiler treatment according to the present disclosure.

[0065] FIG. 5 illustrates an ontology of compilers including their inputs, processing, and outputs.

[0066] FIG. 6 schematically contrasts prior art treatment of executables with executables according to the present disclosure.

[0067] FIG. 7 is an ontology of source code 188.

[0068] FIG. 8 is an example of generic library source code 118 that defines a function that receives parameters and performs a transformation on input data. The example is shown without enclave-specific constructs or SDK-dependent enclave lifecycle logic (FIGS. 24A-C), thereby illustrating generic source code that may be processed by a traditional compiler or an enclave-aware compiler 122.

[0069] FIG. 9 is an example of generic main source code 236 that includes a program entry point and an external call to process_record. The example source code is shown without enclave-specific interface definitions, explicit enclave lifecycle calls, manually written enclave-transition wrappers, or explicit marshaling code (FIGS. 24A-C).

[0070] FIG. 10 is an example command sequence for compiling and linking the source code of FIGS. 8-9. The commands illustrate that a generic library source file may be compiled into a library executable and that a generic main source file may be linked against the library executable. In certain embodiments, comparable build inputs may be processed by an enclave-aware compiler 122 or toolchain to generate eABI-aware or enclave-aware executables.

[0071] FIG. 11 is a prior art schematic diagram illustrating a traditional compilation and load model. This drawing also illustrates the difference between an Application Programming Interface (API) and an Application Binary Interface (ABI).

[0072] FIG. 12 schematically illustrates the relationship between a calling executable and a called executable; an external symbol dependency 184 and a published symbol 194; and an external call and a return.

[0073] FIG. 13 is an ontology of how symbols are resolved between executables in certain eABI-aware embodiments.

[0074] FIG. 14 is a prior art schematic diagram illustrating loading of a traditional executable file 234 and its sections into common memory 166.

[0075] FIG. 15 schematically illustrates the loading of an enclave-aware executable file 264 and both its protected sections 156 and unprotected sections 154 into a usermode process 150.

[0076] FIG. 16 schematically illustrates relationships between executable files and loaded executables; traditional and eABI-aware executables; and contrasts a traditional loader with an enclave-aware loader.

[0077] FIG. 17 is an ontology of loader functionality.

[0078] FIG. 18 is a prior art schematic diagram illustrating SDK-generated and user-written source-code artifacts used in an SGX SDK development model. User-written SDK-aware source code 332 for unprotected functions, user-written SDK-aware source code for protected functions, and a user-written enclave definition in EDL may be processed through an Edger8r tool. A traditional compiler 330 may generate traditional executables 334 that are dependent on an SDK library. The figure illustrates how SDK-aware source code in the prior art must explicitly express enclave interfaces and may depend on an SDK library.

[0079] FIG. 19 is a prior art schematic diagram illustrating a library OS and traditional loader 336 included within a Gramine SGX enclave, together with one or more usermode processes 150, a program executable, a library executable, and a standard C library. The figure illustrates how multiple executable components may be placed within a single enclave environment, creating a process-sized attack surface within the enclave without provenance or verification that the executables have not been tampered with.

[0080] FIG. 20 is a prior art schematic diagram illustrating the memory model of an SGX SDK-based enclave.

[0081] FIG. 21 is a prior art schematic diagram illustrating traditional compilation, loading, and execution in common memory.

[0082] FIG. 22 schematically illustrates enclave-aware compilation from generic source code including loading and execution according to certain embodiments.

[0083] FIG. 23 is a prior art schematic diagram illustrating dependent executables 280.

[0084] FIG. 24A is an example of the SGX SDK-aware enclave definition language (EDL) defining trusted and untrusted interfaces.

[0085] FIG. 24B is an SGX SDK configuration file defining enclave parameters in XML and not C.

[0086] FIG. 24C shows C source code that explicitly creates, uses, and destroys an enclave through SGX SDK-specific calls. The examples illustrate source-level enclave constructs required by SGX SDK-aware development models for managing the lifecycle of an enclave.

[0087] FIG. 25 is a comparative table contrasting SGX SDK development, Library OS enclave execution, and the enclave-aware architecture described herein.

[0088] FIG. 26 schematically illustrates categories of processor instructions 120 within a processor 106.

[0089] FIG. 27 is an ontology illustrating the types of instructions that can be executed by various processors.

[0090] FIG. 28 is an ontology categorizing sections 152.

[0091] FIG. 29 schematically illustrates various types of memory such as how a usermode process 150 may include a common virtual address space 220 having common memory 166, an entry / exit bootstrap module 288, an eABI-aware runtime 180, a loaded eABI-common executable 250, and two enclaves. The figure illustrates that multiple execution environments may coexist within a usermode process.

[0092] FIG. 30 is an ontology of memory 108 and execution-environment categories.

[0093] FIG. 31 schematically illustrates how enclave-aware source code may include public and private data designations and a main function. Generic source code may include ‘aSubroutine’, and restricted source code 206 may include code having a restricted instruction 204. Enclave-aware compilation may generate an enclave-aware main executable 196, a library enclave 202 executable, and an eABI-common executable 208. After loading, a usermode process 150 may include an entry / exit bootstrap module 288, eABI-aware runtime 180, main enclave 200, library enclave, loaded eABI-common executable 250, enclave-aware cryptography 260, and corresponding protected, unprotected, published-symbol, and import information.

[0094] FIG. 32 schematically illustrates an eABI-mediated call flow within a usermode process 150 to perform a system call on behalf of code executing in an enclave and return results through notes copied between executables using transit buffers 308.

[0095] FIG. 33 is a flowchart illustrating dispatch, route, and deliver phases for note processing.

[0096] FIG. 34 schematically illustrates dispatch, routing, and delivery of a note 212 between a source enclave and a target enclave.

[0097] FIG. 35 schematically illustrates a compiler-generated eABI-common restricted operation dataflow.

[0098] FIG. 36 schematically illustrates an example note-mediated call to a library function between a main enclave 200 and a library enclave 202.

[0099] FIG. 37 schematically illustrates an initialization and execution sequence involving an enclave-aware loader 146.

[0100] FIG. 38 is an ontology illustrating categories of restricted operations.

[0101] FIG. 39 is a table illustrating example data security modes 130. The table characterizes each mode in relation to confidentiality and integrity, assured identity, and resistance to cryptanalytic attacks. The modes are illustrative and may be supplemented, omitted, or combined in certain embodiments.

[0102] FIG. 40 is an ontology of runtime categories.

[0103] FIG. 41 is an ontology of data security modes 130.

[0104] FIG. 42 is a Venn diagram illustrating the selection of a selected data security mode from sets of candidate data security modes and allowed data security modes.

[0105] FIG. 43 is a table illustrating accessibility of processor instructions 120 and data across various execution environments.

[0106] FIG. 44 is a table illustrating relationships between desired security and available data security modes 130.

[0107] FIG. 45 is a table illustrating the pros and cons of storing data in trusted execution environments or in common memory 166.

[0108] FIG. 46 illustrates example enclave-aware source code 142 using public and private storage annotations.

[0109] FIG. 47 is a table illustrating enclave-aware storage classes 270.

[0110] FIG. 48 illustrates example enclave command line parameters 140 for assigning default storage and data security modes.

[0111] FIGS. 49A and 49B are comparative tables illustrating differences between a traditional ABI 342 and an enclave-aware ABI 114. The comparison illustrates that an eABI may provide binary interoperability among eABI-aware executables 112 across common memory, enclaves, and other execution environments.

[0112] FIG. 50 schematically illustrates an example note 212 or kernel note 410 layout.

[0113] FIG. 51 is an ontology of notes 212.

[0114] FIG. 52 is a table illustrating the differences between the share-by-choice mode and the protect-by-choice mode for storing variables by default.

[0115] FIG. 53 is a flowchart illustrating governed launch authorization for an enclave-aware executable file 264.

[0116] FIG. 54 schematically illustrates a kernel-resident trusted execution environment 416 or kernel-resident enclave 402.

[0117] FIG. 55 is an ontology of kernel-related elements associated with the eABI.DETAILED DESCRIPTION OF THE INVENTION

[0118] The following description presents illustrative embodiments and does not limit the claimed subject matter. Unless expressly stated otherwise, method steps need not be performed in the order presented and may be performed concurrently. The articles “a” and “an” mean one or more where the context permits.

[0119] The terms “comprising,”“including,” and “having” are open-ended unless the context expressly requires otherwise. A recited combination therefore may include additional interoperating software or hardware components.

[0120] Although the terms first, second, third, etc. may be used herein to describe various elements, components, regions, layers, and / or sections, these elements, components, regions, layers, and / or sections should not be limited by these terms. These terms may be used only to distinguish one element, component, region, layer, or section from another element, component, region, layer, or section. Terms such as “first,”“second,” and other numerical terms when used herein do not imply a sequence or order unless clearly indicated by the context. Thus, a first element, component, region, layer, or section discussed below could be termed a second element, component, region, layer, or section without departing from the teachings of the example embodiments. For example, references to a first executable, second executable, first enclave, or second enclave are used for clarity and do not require a particular order, hierarchy, location, trust level, or temporal sequence unless expressly stated.

[0121] “Semantics” refers generally to rules, information, structures, or operational behaviors that define, constrain, guide, or indicate how an operation or data structure is interpreted or performed. Semantics may be expressed by processor instructions 120, metadata 244, section attributes, symbol tables 314, note 212 structures, field values, policies, loader behavior, runtime behavior, calling conventions, data layouts, candidate data security modes 372, or combinations thereof.

[0122] The terms below describe components and operations of the enclave-aware execution architecture. Unless expressly stated otherwise, a feature described for one term, component, or embodiment may be used independently or in combination with another disclosed feature.System / Computing Environment

[0123] A “system”100 may include a processor 106 and memory 108. As shown in FIGS. 11 and 29, certain aspects of the system for enhancing security in a computing environment that supports a trusted execution environment 326 or an enclave 104 are illustrated. The system may also include memory in communication with the processor. In certain embodiments, the system may include one or more: processors, memory units, trusted execution environments, enclaves, executable files 190, loaded executables 364, or combinations thereof.

[0124] A “processor”106 (FIGS. 26-27) refers generally to hardware configured to execute processor instructions 120. A processor may include one or more cores, execution units, registers, caches, memory management components, or combinations thereof. A processor may execute processor instructions, privileged instructions 242, unprivileged instructions 254, enclave-aware instructions 128, restricted instructions 204, or combinations thereof. A processor may also include, by way of non-limiting example, a central processing unit (CPU), microprocessor, microcontroller, system-on-chip (SoC), virtual processor, hardware thread, or other instruction executing device. A processor may be implemented in hardware, virtualized hardware, emulated hardware, firmware-assisted execution environments, system-on-chip architectures, or combinations thereof. The processor may include a single processor or multiple processors in a single processing unit (e.g., a central processing unit) or multiple processing units (e.g., a central processing unit and a graphics processing unit; or a central processing unit and a memory manager). A PHOSITA would understand that traditional processors 324 may execute privileged instructions or unprivileged instructions that support privilege domains such as kernelmode and usermode. In certain embodiments, one processor may execute one or more operations described herein, another processor may execute one or more other operations described herein, or multiple processors may cooperate to execute one or more operations described herein.

[0125] A processor 106 (FIG. 27) may include a “traditional processor”324, which refers to a processor configured to execute instructions within conventional execution environments without hardware-enforced enclave isolation. A PHOSITA would understand that traditional processors may rely on operating system-managed process isolation rather than hardware-based isolation. A traditional processor may not be aware of enclave-aware instructions 128 or may not distinguish restricted instructions 204 from other processor instructions 120 for purposes of trusted execution environment enforcement. In certain embodiments, a traditional processor may execute generic source code 118 after compilation into a traditional executable 334, but may not provide hardware support that may be used by an enclave-aware loader 146, eABI-aware runtime 180, or eABI 114 to enforce execution within an enclave 104.

[0126] An “enclave-aware processor”124 is a processor 106 configured to support one or more trusted execution environments326, such as enclaves 104. The enclave-aware processor may include hardware, microcode, firmware, memory-management mechanisms, or combinations thereof that enforce isolation between trusted execution environments and common memory, support enclave-aware instructions 128 and controlled transitions, enforce restricted-instruction policies, and protect enclave memory from processor instructions executing outside the enclave.

[0127] An enclave-aware processor 124 may support enclave creation, loading, measurement, initialization, entry, exit, attestation, key management, and removal. It may enforce memory-access rules that prevent code outside an enclave 104 from accessing protected enclave memory while permitting code inside the enclave to access authorized enclave and common memory regions. An enclave-aware loader 146, eABI-aware runtime 180, operating system 148, hypervisor 226, firmware, kernel component, or combination thereof may initiate, coordinate, request, or validate TEE lifecycle operations.

[0128] In some embodiments, an enclave-aware processor 124 may include hardware support for trusted execution environments (TEEs) 326 including, by way of non-limiting example, Intel® Software Guard Extensions (SGX) enclave technology, ARM® TrustZone® isolation technology, AMD® Secure Encrypted Virtualization (SEV) confidential computing technology, RISC-V enclave extensions, or other enclave-capable architectures.

[0129] Unless otherwise specified, references to a “processor”106 are not limited to traditional processors 324 and may include enclave-aware processors 124 described herein.Non-Transitory Computer-Readable Medium

[0130] “Non-transitory computer-readable medium”346 refers to one or more non-transitory storage media or storage resources configured to store computer-readable data before the data is loaded into memory 108 or otherwise used by a processor 106. A non-transitory computer-readable medium may include persistent storage, non-volatile memory, a filesystem, solid state storage, magnetic storage, optical storage, firmware storage, removable storage, network accessible storage, cloud storage, or combinations thereof. The computer-readable data may include source code 188, object code, executable files 190, libraries 328, metadata 244, eABI metadata 246, symbol tables 314, certificates 168, cryptographic keys, policies, configuration information, processor instructions 120, enclave-aware instructions 128, or combinations thereof.

[0131] In certain embodiments, the non-transitory computer-readable medium 346 may store one or more executable files 190 including a traditional executable file 234, eABI-aware executable file 238, enclave-aware executable file 264, eABI-common executable file 248, or combinations thereof. A loader, including a traditional loader 336 or enclave-aware loader 146, may load at least a portion of an executable file from the non-transitory computer-readable medium into memory 108 to form a loaded executable 364.

[0132] In certain embodiments, one or more non-transitory computer-readable media 346 store instructions that cause a processor to translate generic source code 118 into an eABI-common executable file 248, load at least part of that file into common memory 166 (FIG. 35) as a loaded eABI-common executable 250, and support an eABI-governed restricted operation request and return between the loaded eABI-common executable and a loaded enclave-aware executable 268.

[0133] In certain embodiments, a non-transitory computer-readable medium 346 stores instructions that cause one or more processors 106 to analyze an eABI-aware executable file 238 or enclave-aware executable file 264; load protected sections 156 into a trusted execution environment 326 and unprotected sections 154 into common memory 166 (FIG. 15); validate eABI trust evidence 382 (FIG. 53); initialize or cooperate with an eABI-aware runtime 180; and form, route, deliver, or process notes 212 (FIG. 32) for eABI-governed interoperability.

[0134] In certain embodiments, processor instructions stored in one or more non-transitory computer-readable media 346 may cause one or more processors, loaded eABI-aware executables 240, an eABI-aware runtime 180, an enclave-aware loader 146, an entry / exit bootstrap module 288, or combinations thereof to perform method operations described herein. Such instructions may cause the one or more processors to maintain execution environments, form loaded eABI-aware executables, identify eABI metadata 246, apply binary-level semantics defined by the eABI, mediate or dispatch control transfer or data exchange, form or process notes 212, apply validation semantics, or otherwise support eABI-governed interoperability among loaded executables in different execution environments.Processor Instructions

[0135] Certain terms are used herein to describe instruction types associated with execution within enclave-aware computing environments. Unless otherwise specified, these terms are intended to be interpreted broadly and may encompass processor instructions 120, enclave-aware instructions 128, restricted instructions 204, and related instruction types.

[0136] A “processor instruction”120 (FIGS. 26-27) refers to an instruction executable by a processor 106 according to a processor instruction set architecture. Processor instructions may include machine instructions, an instruction set, bytecode, micro-operations, encoded processor instructions, pseudo-instructions, or combinations thereof. Instructions may operate on registers, memory 108, control flow, system state, or other processor-visible resources. In certain embodiments, processor instructions may include instructions generated from generic source code 118, instructions included in an executable 110, instructions included in a loaded executable 364, instructions configured to execute in common memory 166, or instructions configured to execute in a trusted execution environment 326.

[0137] Processor instructions 120 may execute inside or outside an enclave 104 unless restricted by the processor 106, memory manager, or execution environment.

[0138] An “enclave-aware instruction”128 may be a processor instruction 120 associated with enclave-based execution semantics. In certain embodiments, enclave-aware instructions may be configured to enter an enclave 104, exit an enclave, create an enclave, perform enclave attestation, perform enclave key operations, or otherwise interoperate with TEEs 326 such as enclaves. In certain embodiments, enclave-aware instructions may be generated, emitted, stored, loaded, or executed in connection with an enclave-aware compiler 122, enclave-aware loader 146, enclave-aware executable 126, or combinations thereof.

[0139] Enclave-aware instructions 128 may fall into two categories, including privileged enclave-aware instructions for managing enclaves, and unprivileged enclave-aware instructions for interoperating with an enclave (FIGS. 26-27). Privileged enclave-aware instructions may create, verify, initialize, or remove an enclave. Unprivileged enclave-aware instructions may enter or exit an enclave, may use enclave-aware cryptography 260, or may securely determine enclave identity, measurement, provenance, trust status, attestation status, or combinations thereof.

[0140] A “restricted instruction”204 (FIGS. 26-27, 38, and 43) refers to a processor instruction 120 that is restricted from execution within a trusted execution environment (TEE) 326 such as an enclave. A PHOSITA would understand that restricted instructions may compromise enclave isolation, access privileged resources, modify system state, perform direct system calls 232, access restricted hardware resources, or otherwise conflict with restrictions associated with trusted execution environments. For example, restricted instructions may include system calls such as “SYSCALL,” hypervisor 226 calls such as “VMCALL,” or other instructions that are not allowed to execute inside an enclave such as “CPUID.”

[0141] Unless otherwise specified, references to “processor instructions”120 may include privileged instructions 242, unprivileged instructions 254, enclave-aware instructions 128, restricted instructions 204, or combinations thereof.

[0142] A “thread of execution”224 may refer to a sequence of processor instructions 120 executed by a processor 106. The thread of execution may represent the smallest unit of processing that may be scheduled independently by an operating system 148. The thread of execution may enter or exit a TEE or an enclave 104. Multiple threads of execution may run concurrently in a system 100. The thread of execution may share resources such as the common virtual address space 220, open files, and execution state with other threads of execution while each thread maintains its own independent execution flow. The thread of execution may run inside an enclave, executing an instruction whose address is inside the enclave and accessing data or other instructions within the enclave (FIG. 43). However, the thread of execution may be restricted from executing a restricted instruction 204 while inside an enclave. When a thread of execution is executing a processor instruction outside an enclave, the thread of execution may execute a restricted instruction.

[0143] When a thread of execution 224 is executing a processor instruction 120 outside an enclave 104, the thread of execution may not access data inside an enclave (FIG. 43).Memory

[0144] The “memory”108 (FIGS. 29-30) may include data and processor instructions 120. Memory may be partitioned in various ways depending on the desired functionality, such as into kernel memory, userspace memory, common memory 166, one or more trusted execution environments 326, one or more enclaves 104, or combinations thereof. In certain embodiments, memory may include or be mapped to a common virtual address space 220 within a usermode process 150. A memory may include a single memory unit or multiple memory units.

[0145] The “common virtual address space”220 may be mapped from memory 108 or may include common memory 166. A PHOSITA would appreciate that the common virtual address space may include common memory, one or more enclaves 104, one or more trusted execution environments 326, one or more loaded executables 364, or combinations thereof for use by a usermode process 150 (FIGS. 29-30). In certain embodiments, the common virtual address space may provide an addressable execution environment in which an enclave-aware loader 146 loads unprotected portions of executable files into common memory and protected portions of executable files into one or more enclaves or trusted execution environments.

[0146] The “usermode process”150 may perform a substantial portion of the workload 252 of the system 100. The usermode process is a partitioning scheme (FIG. 3) and may isolate the workload, improving safety and security. The usermode process may be configured to allow only a subset of processor instructions 120 to execute, which may be referred to as unprivileged instructions 254. In certain embodiments, the usermode process may include a common virtual address space 220, common memory 166, one or more trusted execution environments 326, one or more enclaves 104, loaded executables 364, an enclave-aware loader 146, an eABI-aware runtime 180, transit buffers 308, or combinations thereof. The usermode process may support executable-level or sub-process isolation while permitting controlled interoperability between loaded executables according to the eABI.

[0147] “Common memory”166 may be in the common virtual address space 220 and may include memory 108 that does not contain an enclave 104 (FIGS. 29-30). The common memory may also include a loaded eABI-common executable 250. However, the common memory need not include an enclave or protected sections 156. Data and processor instructions 120 in common memory may be mapped into memory from the unprotected sections 154 of an executable (FIG. 15). Data and processor instructions in common memory may be accessible from any thread of execution 224 in the usermode process 150, subject to access protections, operating system permissions, memory management rules, or other protections applicable to the usermode process.

[0148] It should be appreciated that common memory 166 may provide interoperability among loaded executables 364 while offering a different protection model than a trusted execution environment 326 or enclave 104. In certain embodiments, an enclave-aware loader 146 may load unprotected sections 154 into common memory, and an eABI-aware runtime 180 may use common memory, transit buffers 308, notes 212, or loaded eABI-common executables 250 to support eABI-governed control transfer or data exchange between loaded executables in different execution environments (FIG. 32).

[0149] Common memory 166 and TEEs 326 may use different initialization, access control, and control transfer mechanisms. Common memory may be mapped with ordinary read, write, or execute permissions and may permit control transfer to addresses allowed by the operating system, whereas an enclave or TEE may require measured or validated initialization and entry through defined entry points. An enclave or TEE may maintain enclave-compatible cryptographic keys 170 and other protected state not made available in unprotected form in common memory.

[0150] In certain embodiments, code or data that uses restricted instructions 204, operating system services, system calls 232, hypervisor 226 calls, traditional runtime services, common memory services, or eABI-common executable services may be placed in common memory 166 while protected code or protected data is placed in one or more trusted execution environments 326 according to eABI metadata 246, section attributes, data security modes 130, policy, or combinations thereof (FIGS. 31, 35, and 38).

[0151] An “execution environment” refers to a memory region in which processor instructions of a loaded executable, executable portion, or section are configured to execute. An execution environment may include common memory 166, a trusted execution environment (TEE) 326 such as an enclave 104, a kernel-resident trusted execution environment 416 such as a kernel-resident enclave 402, a protected memory region, an unprotected memory region, a usermode execution domain, a kernelmode execution domain, or combinations thereof. An execution environment may be established, selected, identified, or initialized based at least in part on target execution environment information 266, loader analysis, runtime configuration, processor configuration, memory permissions, trust policy 386, isolation rules, or combinations thereof.

[0152] An “execution context”420 refers to invocation-specific, per-call, per-thread, per-transition, or return-path state associated with a calling executable, thread of execution 224, control transfer 214, data exchange 312, note 212, outbound note 290, return note, or combination thereof and used to suspend, correlate, restore, resume, or complete execution associated with an invocation. The execution context may include register state, stack state, base-pointer state, stack-pointer state, instruction-pointer state, argument state, return state, note state, runtime state, selected data security mode state, thread state, an invocation identifier, note identifier, return-path identifier, replay resistance value, return-routing information, or combinations thereof.

[0153] A calling execution context refers to an execution context 420 associated with an invocation initiated by a calling executable.

[0154] In certain embodiments, an execution environment refers to a memory, execution, privilege, isolation, or protection domain in which one or more loaded executables may execute or be prepared for execution. In contrast, an execution context 420 refers to per-call, per-thread, per-transition, or per-invocation state used during execution or interoperability, including register state, stack state, argument state, return state, note state, runtime state, selected data security mode state, or combinations thereof. An execution environment may contain or be associated with one or more execution contexts, but the terms are not coextensive.

[0155] An “enclave”104 is a type of trusted execution environment (TEE) 326. An enclave may refer to a trusted execution environment mapped into, associated with, or otherwise made available to a usermode process 150, common virtual address space 220, kernel, hypervisor, firmware component, or other execution environment. An enclave may provide security properties different from common memory 166 and may be protected from direct access by code executing outside the enclave (FIG. 43). A usermode process may include one or more enclaves. Data and processor instructions 120 in an enclave may be mapped from protected sections 156 of an enclave-aware executable 126. The protected sections may be digitally signed or otherwise associated with cryptographic signature 228, certificate 168, enclave-compatible cryptographic key 170, eABI metadata 246, or combinations thereof. The enclave may support verification that the data and processor instructions added to the enclave have not been tampered with or are otherwise authorized for trusted execution.

[0156] Unless the context requires an enclave-specific hardware mechanism, operations described herein for creating, loading, provisioning, initializing, registering, or otherwise preparing an enclave may also be performed for a trusted execution environment that provides corresponding lifecycle, isolation, access-control, or protected-execution functionality.

[0157] A “trusted execution environment”326 such as an enclave 104 may employ cryptographic techniques, enforcement mechanisms, access control mechanisms, memory management mechanisms, processor-enforced mechanisms, or combinations thereof to create a protected boundary within memory 108. Examples of trusted execution environment technologies may include Intel® Software Guard Extensions (SGX) enclave technology, AMD® Secure Encrypted Virtualization (SEV) confidential computing technology, ARM® TrustZone® isolation technology, Apple® Secure Enclave® security module, RISC-V® Keystone Enclave open standard technology, Qualcomm® Secure Execution Environment (QSEE) trusted execution environment, Huawei® Trusted Execution Environment, or combinations thereof. An enclave may be implemented using CPU instructions, GPU instructions, memory managers, hypervisors 226, dedicated hardware, firmware, microcode, secure monitors, virtualization mechanisms, or combinations thereof.

[0158] When a thread of execution 224 outside an enclave 104 attempts to access contents of the enclave, the thread of execution may fail or may be prevented from completing the attempted access according to processor-enforced, memory management, or trusted execution environment restrictions (FIG. 43). A thread of execution inside an enclave may access data or processor instructions 120 within that enclave and may access selected data in common memory 166 according to applicable rules. A thread of execution inside an enclave may be restricted from executing instructions in common memory without exiting the enclave, using a controlled transition, invoking an eABI-common executable 208, forming a note 212, or otherwise following eABI-defined semantics.

[0159] As used herein, the term “enclave”104 may refer to a single enclave instance or to any one of multiple enclave instances that may concurrently exist within a usermode process 150 or other execution environment. More than one enclave may be created, loaded, initialized, or executed by an enclave-aware loader 146, and each such enclave instance may be configured to interoperate with the usermode process, with other enclaves, with common memory 166, with a loaded executable 364, or combinations thereof according to the eABI 114, through an eABI-aware runtime 180, by using notes 212, or combinations thereof. References in this description to “the enclave” are intended to encompass any enclave instance or a plurality of enclaves, unless the context expressly indicates otherwise.

[0160] Prior to initialization, the contents of an enclave 104 may be visible to an operating system 148 or other loading component; however, the enclave-aware processor 124 may be restricted from executing processor instructions 120 within the enclave. Initialization may transition the enclave from a constructed, loaded, or provisioned state into an execution-ready state in which selected processor instructions within the enclave may be executed and selected data within the enclave may be protected from direct access by code executing outside the enclave.

[0161] Initializing a trusted execution environment 326, including an enclave 104, may include creating, measuring, validating, authenticating, attesting, provisioning, configuring, or otherwise preparing the trusted execution environment for execution. Initializing the trusted execution environment may include verifying that an enclave-compatible cryptographic key 170 used to initialize the trusted execution environment or protected executable portion therein is trusted by the system 100, creating a secure identity for the trusted execution environment, authenticating or attesting other trusted execution environments or enclaves in the usermode process 150, evaluating trustworthiness of other trusted execution environments or enclaves, creating a secure enclave-compatible cryptographic key for use between trusted execution environments or enclaves, or combinations thereof. Initializing the trusted execution environment may also include initializing protected execution-environment data structures within, or associated with, the trusted execution environment, including a private stack, private heap, dispatch table, symbol table 314, key table, trust table, external symbol dependency map, published symbol map, or combinations thereof, without requiring significant developer involvement (FIG. 37).

[0162] Initializing a trusted execution environment 326, including an enclave 104, may further include obtaining published symbol information from one or more loaded executables 364 (FIG. 37), determining which loaded executable or trusted execution environment includes a semantically compatible published symbol 194, maintaining within, or in association with, the trusted execution environment a map of external symbol dependencies 184 to corresponding published symbols, and informing an eABI-aware runtime 180, another enclave, another trusted execution environment, another loaded executable, or combinations thereof that the trusted execution environment is initialized. The initialization information may be used to support symbol resolution, note routing, note dispatch, validation, data security mode 130 selection, or eABI-governed control transfer or data exchange among loaded executables.

[0163] In certain embodiments, a first trusted execution environment and a second trusted execution environment within a common virtual address space may be initialized with respective protected execution-environment data structures. The respective protected execution-environment data structures may include respective private stacks, private heaps, dispatch tables, symbol tables, key tables, trust tables, external symbol dependency maps, published symbol maps, or combinations thereof. Such structures may be initialized separately for loaded eABI-aware executables occupying different trusted execution environments so that symbol resolution, controlled entry, validation, data exchange, control transfer, or combinations thereof are maintained according to the eABI for the corresponding trusted execution environment.

[0164] During initialization, an enclave 104 may be cryptographically verified to determine the enclave's integrity or authenticity, thereby providing assurance that the enclave has not been tampered with and conforms to an expected configuration. After a successful verification, contents of the enclave may not be visible to privileged threads, e.g., an operating system 148 or threads running in common memory 166. After a successful verification, processor instructions 120 within the enclave may be executed by an enclave-aware processor 124, and the enclave may securely store or process protected code, protected data, protected sections 156, sensitive information, cryptographic material, metadata, or combinations thereof. The enclave may be cryptographically re-validated to verify that it is an intended enclave, including by verifying that an unauthorized, substituted, or unintended enclave has not been mapped instead of the intended enclave.

[0165] In some conventional implementations, an enclave 104, trusted execution environment 326, protected section 156, or enclave-aware executable 126 may be associated with a cryptographic signature 228 that supports integrity verification, while the cryptographic signature need not be associated with a certificate 168, certificate chain 388, certificate-based public key infrastructure 172, publisher identity, provenance information 380, or other information demonstrating an origin, attribution, or trust status of the signed code or data.

[0166] An “enclave-compatible cryptographic key”170 is used to verify that the data and code loaded into an enclave are genuine and have not been tampered with since they were digitally signed by a publisher using an enclave-compatible cryptographic key. An enclave-compatible cryptographic key may be bound to, derived from, included in, authenticated by, certified by, referenced by, or otherwise associated with a certificate 168 associated with an enclave-aware executable file 264 or protected section 156. An enclave-aware loader 146 may verify the relationship between the enclave-compatible cryptographic key and the certificate before initializing a trusted execution environment 326 containing a loaded enclave-aware executable 268.

[0167] In certain embodiments, the verification may be used to detect, prevent, restrict, or respond to substitution of an unauthorized key, certificate, protected section, executable file 190, or combinations thereof before protected code or data is admitted into the trusted execution environment.

[0168] In certain embodiments, the enclave-compatible cryptographic key may be used to support enclave initialization, integrity verification, attestation, data security mode 130 processing, interoperability according to the eABI, governed launch, or combinations thereof.

[0169] In certain embodiments, when verification of the relationship between the enclave-compatible cryptographic key used to initialize the trusted execution environment and the certificate fails, the enclave-aware loader 146 may generate or update a trust determination to indicate that initialization of the trusted execution environment 326 is not permitted and may refrain from or prevent initializing the trusted execution environment.

[0170] A “main enclave”200 (FIG. 37) may contain or correspond to a loaded enclave-aware executable 268 that initiates execution of a workload 252 through a published symbol 194 or entry point 262 accessible to an entry / exit bootstrap module 288. A main enclave may depend on one or more library enclaves 202 or loaded eABI-common executables 250 and may be designated as a first or second enclave without implying a fixed invocation role.

[0171] A “library enclave”202 may contain or correspond to a loaded enclave-aware executable 268 that publishes one or more symbols 194, functions, services, or data used to satisfy external symbol dependencies 184 of another executable. A library enclave may have its own dependent executables 280 (FIG. 23), may interoperate through the eABI 114, and may be designated as a first or second enclave without implying a fixed calling or called role.Application Binary Interface (ABI)

[0172] An “Application Binary Interface” (ABI) (FIG. 2) is a binary-level interface governing interoperability between compiled software components. An ABI may define calling conventions, register and stack use, parameter and return handling, symbol resolution, datatype layout and alignment, exception handling, system call mechanisms, or combinations thereof, and may be implemented or used by compilers, loaders, runtimes, executables, or operating systems.

[0173] A “traditional ABI”342 is an ABI for traditional executables 334 operating in common memory 166 of a common virtual address space 220 through direct calls, shared memory, and conventional calling conventions. A traditional ABI need not define binary-level semantics for interoperability across enclave or other trusted execution environment boundaries.

[0174] An “enclave-aware Application Binary Interface” (eABI) 114 (FIGS. 1-2) is an ABI that defines binary-level semantics for control transfer or data exchange between loaded executables in different execution environments, including common memory 166, enclaves 104, other trusted execution environments 326, kernel-resident trusted execution environments 416, and untrusted execution environments configured for eABI participation. The eABI may define symbol resolution, note formation, dispatch, routing, delivery, data transfer, controlled entry, return processing, validation, restricted-operation requests, and data security modes 130.

[0175] The eABI 114 may govern interoperability (FIGS. 49A-B) among eABI-aware, enclave-aware, and eABI-common executable files and loaded executables; an eABI-aware runtime 180; an enclave-aware loader 146; an entry / exit bootstrap module 288; common memory 166; enclaves 104; usermode and kernel execution environments and binary-level semantics; and combinations thereof.

[0176] The eABI 114 may preserve selected traditional ABI behavior for intra-executable or common memory operations while adding semantics for calls, data transfer, symbol access, notes 212, restricted operations, or isolated kernel resource access across execution environment boundaries. It may apply where a thread lacks access to all memory in a usermode process 150 or crosses a boundary among usermode, kernelmode, common memory, trusted, untrusted, and protected execution environments.

[0177] The eABI 114 may be embodied by executable file and symbol metadata, eABI metadata 246, processor instructions 120, note 212 structures (FIG. 50), dispatch and routing rules (FIGS. 33-34), return path rules, transit buffer rules, data security mode (FIG. 39) rules, and other runtime behaviors rather than only by a written interface specification. An enclave-aware compiler 122 may generate the eABI metadata, note formation, and processor instructions that implement the applicable semantics.

[0178] “Data exchange”312 refers to data, arguments, return values, status information, copied data, referenced data, descriptors, pointers, handles, metadata 244, or combinations thereof used for control transfer 214, symbol access, note processing, or combinations thereof according to the eABI. The data to be exchanged may be stored in common memory 166, an enclave 104, a trusted execution environment 326, a note, a protected payload 276, a transit buffer 308, or combinations thereof. The data to be exchanged may be represented, copied, protected, validated, or transferred according to eABI metadata 246, note formation semantics 370, selected data security mode 374, policy, or combinations thereof.

[0179] An “external reference”366 refers to a call, access, invocation, read, write, or other use by a loaded executable 364 of functionality or data associated with a symbol defined outside that loaded executable. An external reference may correspond to an external symbol dependency 184, imported or published symbol 194, relocation, function or data symbol, service, entry point 262, control transfer 214, or combination thereof.

[0180] A “control transfer”214 is an eABI-governed transfer for a thread of execution 224 from a calling loaded executable 364 in a first execution environment to callable functionality associated with a called loaded executable, a common-memory executable, a kernel service interface, or other target functionality in a different execution environment. A local branch, local function call, or other intra-executable change in an instruction pointer, program counter, call stack, or equivalent processor execution state that remains within the same loaded executable and the same execution environment is not, by itself, a control transfer in this eABI sense. In an eABI-aware environment, the requested target of the control transfer may be represented by an external symbol dependency 184, resolved to a published symbol 194 and a defined entry point 262, and coordinated using note 212 formation, dispatch, routing, delivery through the defined entry point, direct note transfer, or a combination thereof according to the eABI 114.

[0181] A “dependency rule” refers to one or more criteria, requirements, constraints, or policy values used to determine whether an external symbol dependency 184 may be resolved to a published symbol 194, whether a loaded executable 364 is eligible to satisfy the external symbol dependency, or which of multiple published symbols may be selected to satisfy the external symbol dependency. A dependency rule may be based on a symbol name, symbol hash, datatype, function prototype, calling convention, executable identity, executable version, publisher identity, provenance information 380, certificate 168 status, trust determination, target execution environment information 266, data security mode 130, or combinations thereof.

[0182] The eABI 114 may govern calling and called executable roles; outbound, inbound, and return notes; runtime-mediated transfer through a transit buffer 308 or processor-supported direct note transfer; selected data security modes; routable envelopes; protected, argument, referenced-data, return, common, syscall, and kernel payloads; and corresponding dispatch, routing, delivery, data-transfer, controlled-entry, validation, and return semantics.

[0183] A “calling executable” (FIG. 12) refers to a loaded eABI-aware executable 240 that, for a particular invocation, initiates or requests control transfer, data exchange, symbol access, performance of functionality, or a combination thereof according to the eABI 114.

[0184] A “called executable” refers to a loaded eABI-aware executable that, for the particular invocation, receives or delivers the invocation and performs, provides, or controls access to the requested functionality, data, service, or combination thereof. The calling executable and called executable roles are relative to the particular invocation and are not permanent properties of the loaded eABI-aware executables. A loaded eABI-aware executable that is the called executable for one invocation may be the calling executable for another invocation (FIG. 23).

[0185] For a particular invocation, the calling executable remains the calling executable and the called executable remains the called executable during an associated return pathway. Accordingly, dispatch of a return note by the called executable and delivery of the return note by the calling executable does not reverse the calling executable and called executable roles for the original invocation.

[0186] “Called functionality” refers to a function, service, operation, data access, or other functionality performed or provided in response to an invocation by a called executable, isolated kernel code 418, a kernel service interface 414, or another execution component associated with the destination of the invocation. Use of the term called functionality does not require the execution component providing the functionality to constitute a separately loaded executable.

[0187] The eABI 114 may define symbol resolution semantics for resolving an external symbol dependency 184 associated with one loaded executable 364 to a published symbol 194 associated with another loaded executable (FIGS. 12-13). The loaded executables may reside in different execution environments, including common memory 166, a trusted execution environment 326, an enclave 104, a kernel-resident enclave 402, a kernel-resident trusted execution environment 416, a protected memory region, or combinations thereof. The eABI-aware runtime 180, enclave-aware loader 146, loaded executable, operating system 148, kernel component, hypervisor 226, or another system 100 component may use the symbol resolution semantics, or runtime information derived from the symbol resolution semantics, to facilitate control transfer, data exchange, note formation, note dispatch, return processing, access to a defined entry point 262 corresponding to the published symbol, access to a kernel service interface 414, or combinations thereof. This may permit compiler-generated executables to interoperate across untrusted and trusted execution environments without requiring source-level SDK-aware constructs.

[0188] Symbol resolution semantics defined by the eABI 114 may include semantically matching an external symbol dependency 184 to a published symbol 194 using one or more compatibility criteria. The compatibility criteria may include a symbol name, symbol hash, datatype, return datatype, parameter datatype, function prototype, calling convention, version, data security requirement, permitted data security mode 130, certificate 168 status, trust status, production mode 174 compatibility, target execution environment information 266, usermode or kernelmode execution status, publisher identity, provenance information 380, symbol-level policy, note-level policy, or combinations thereof. Semantic matching may include determining that the external symbol dependency and the published symbol are identical, equivalent, compatible, authorized, or otherwise resolvable according to the eABI.

[0189] In certain embodiments, resolving an external symbol dependency to a published symbol requires collective satisfaction of multiple compatibility criteria. For a resolution requiring a dependency symbol identifier or dependency symbol hash, a dependency function prototype, a dependency eABI version, and a dependency boundary class, the corresponding published-symbol identifier or published-symbol hash, published-symbol function prototype, published-symbol eABI version, and supported boundary class are each compared. The resolution is accepted only when every required comparison indicates a match or permitted compatibility under the eABI. If any required comparison fails, the resolution is rejected, deferred, or directed to another compatible published symbol.

[0190] Kernel-service symbols may identify isolated kernel code 418 or functionality exposed through a kernel service interface 414 for controlled access to an isolated kernel resource 412, and may be invoked using kernel notes 410. Such symbols may be resolved and accessed under the eABI 114 subject to applicable trust, policy, boundary-class, controlled-entry, and data security mode requirements.

[0191] An “eABI operation” is an operation governed, permitted, restricted, mediated, or performed according to the eABI 114, including symbol publication or access, dependency resolution, note formation or processing, dispatch, routing, delivery, return processing, control transfer 214, data exchange 312, data security mode use, registration, or combinations thereof. A “permitted eABI operation” is an eABI operation authorized by a trust determination, policy, registration record, operation-specific permission, or combination thereof.

[0192] The eABI may be implemented as operational behavior of loaded eABI-aware executables 240, an eABI-aware runtime 180, an enclave-aware loader 146, processor-supported mechanisms, or combinations thereof using eABI metadata, instructions, note structures, phase rules, return rules, validation rules, and data security mode rules described herein.

[0193] “eABI participation” is the ability, eligibility, or authorization of a loaded executable 364, trusted execution environment 326, kernel-resident trusted execution environment 416, kernel service interface 414, or other component to perform one or more eABI operations, including symbol publication or access, dependency resolution, note processing, control transfer, data exchange, return processing, or data-security-mode use.

[0194] eABI participation may be permitted, restricted, or denied based on a trust determination, certificate 168, certificate validation result 378, provenance information 380, production mode 174, selected data security mode 374, policy, registration record, operation-specific permission, or combination thereof. A component that does not satisfy the applicable conditions may be restricted from publishing or satisfying symbols, sending or receiving notes, using selected modes, or performing other eABI operations.Source Code

[0195] Certain terms are used herein to describe forms of source code 188 relevant to the compilation and execution architectures disclosed in the present application. Unless otherwise specified, the term “source code” is used in a generic sense and may refer to generic source code 118, SDK-aware source code 332, enclave-aware source code 142, or other variants.

[0196] “Source code”188 (FIG. 7) refers generally to a human-readable or machine-processable representation of software logic expressed in a programming language, description language, interface language, configuration language, or combination thereof, from which one or more executables 110 may be derived. Source code may include, by way of non-limiting example, program statements, enclave definition language (EDL), declarations, definitions, annotations, interface descriptions, configuration directives, metadata 244, macros, pragmas, build-related constructs, or other information suitable for use by a compiler, preprocessor, code generator, SDK toolchain, or related software development tool. In certain embodiments, source code may be written in languages such as C, C++, Go, Rust, or similar languages. Source code may include information from which processor instructions 120, data, sections 152, symbol tables 314, published symbols 194, external symbol dependencies 184, note formation semantics, data security mode 130 information, certificate 168 information, or combinations thereof may be generated or derived.

[0197] “Generic source code”118 refers to source code 188 written in a conventional programming language (FIGS. 7-9) without requiring SDK-specific constructs for defining enclave semantics, enclave interfaces, enclave lifecycle management, or explicit enclave transitions. A PHOSITA would understand generic source code to include ordinary source code written for compilation by a traditional compiler 330, an enclave-aware compiler 122, or combinations thereof, without requiring the programmer to explicitly define trusted and untrusted boundaries through specialized enclave Software Development Kit (SDK) APIs, enclave definition files, or enclave lifecycle calls. Generic source code may nevertheless be compiled into an enclave-aware executable 126, eABI-aware executable 112, eABI-common executable 208, or combinations thereof when enclave semantics, eABI semantics, section placement, note formation, symbol interoperability, certificate-based trust, or data security mode 130 behavior are introduced by the toolchain.

[0198] Generic source code 118 may be compiled into executable files configured for execution, in whole or in part, in common memory 166, one or more trusted execution environments 326, kernel-resident trusted execution environments 416, or combinations thereof. The enclave-aware compiler 122 may generate protected and unprotected sections, eABI metadata 246, processor instructions 120, note formation information, candidate data security modes, and trust information that support controlled entry, protected placement, note-mediated interoperability, and reduced exposure of unpublished data without requiring SDK-aware source code 332.

[0199] Enclave-aware compiler-generated executable structures may provide executable-level partitioning within a usermode process 150 or other computing environment. Protected and unprotected sections, eABI metadata 246, published-symbol and external-dependency information, note formation semantics, and candidate data security modes 372 may permit an enclave-aware loader 146 and eABI-aware runtime 180 to place and interoperate executable components across common memory 166 and separate trusted execution environments 326 while preserving sub-process isolation (FIG. 31).

[0200] Source code 188 may include “generic main source code”236 that identifies a program entry point 262 and invokes functions or services provided outside the main executable. An enclave-aware compiler 122 may translate the generic main source code into an enclave-aware main executable 196 having a published entry point, external symbol dependencies 184, and processor instructions and eABI metadata 246 for eABI-mediated invocation of dependent functionality.

[0201] Source code 188 may also include generic library source code 274 defining published symbols 194 and associated entry points, and may include external symbol dependencies 184 on other executables. A compiler may derive symbol tables 314, eABI metadata 246, function signature information, note formation information, and routing or resolution information from the source for use by an enclave-aware loader 146, eABI-aware runtime 180, and loaded executables 364.

[0202] “SDK-aware source code”332 refers to source code 188 that expresses enclave semantics through SDK-specific constructs provided by a specialized Software Development Kit (SDK) (FIGS. 18, 20, and 24A-C). A PHOSITA would understand SDK-aware source code to include source code, interface definition code, configuration files, or related build inputs that explicitly define enclave entry points 262, enclave calls, enclave interfaces, enclave boundaries, enclave lifecycle operations, or other enclave behavior using SDK-specific APIs, SDK-specific description languages, SDK-specific datatypes, SDK-specific annotations, or SDK-managed toolchain constructs. SDK-aware source code may include Enclave Definition Language (EDL) declarations, trusted or untrusted interface declarations, explicit enclave creation calls, explicit enclave destruction calls, or other source-level constructs requiring a specialized enclave SDK to compile, build, or manage enclave artifacts. SDK-aware source code may be distinguished from generic source code 118 (FIGS. 8-9) or enclave-aware source code 142 (FIG. 46) where enclave-related behavior is introduced by an enclave-aware compiler 122, enclave-aware loader 146, eABI-aware runtime 180, eABI 114, or combinations thereof rather than by programmer-authored SDK-specific enclave constructs.

[0203] “Enclave-aware source code”142 (FIGS. 46-47) refers to source code 188 that includes source-level information associated with enclave-related behavior while remaining distinct from SDK-aware source code 332 (FIGS. 24A-C). In certain embodiments, enclave-aware source code may include an enclave source code parameter 144, annotation, storage class-like specifier, parameter, attribute, qualifier, pragma, directive, macro, keyword, type qualifier, function attribute, variable attribute, section attribute, command line option (FIG. 48), or other compiler-recognized source-level construct that indicates whether corresponding code, data, variables 286, objects, storage regions, function calls, symbols, or combinations thereof are intended for trusted execution, placement in a trusted execution environment, enclave 104 placement, untrusted execution, placement in an untrusted execution environment such as common memory 166, or other enclave-aware treatment by an enclave-aware compiler 122. For example, storage class-like specifiers such as “public” or “private” may indicate whether a variable is intended for placement in common memory or within an enclave (FIG. 47).

[0204] A “trusted execution environment transition wrapper” refers to manually written source code 188, automatically generated source code, a stub, proxy, trampoline, bridge, or other executable logic that explicitly initiates, performs, or manages control transfer or data exchange across a boundary of a trusted execution environment 326. An enclave-transition wrapper is a trusted execution environment transition wrapper associated with an enclave 104.

[0205] Unlike SDK-aware source code 332, enclave-aware source code 142 (FIG. 46) need not expressly define enclave lifecycle calls, enclave interfaces, or manually written trusted execution environment transition wrappers. It may instead provide compiler-recognized guidance, including annotations, storage class-like specifiers, parameters, attributes, qualifiers, pragmas, directives, macros, or policies that affect protected or common memory placement, published-symbol or external-dependency treatment, data security modes 130, signing, restricted operations, kernel services, or other eABI behavior.

[0206] The following example of enclave-aware source code 142 uses the enclave source code parameter 144“#pragma txMaxThreads 1” to inform the enclave-aware compiler 122 that this program may be configured for one thread of execution 224. In another example, the enclave-aware source code uses a compiler-recognized “private” storage class-like specifier (FIG. 47) to inform the enclave-aware compiler that the integer “i” is to be maintained inside the enclave 104 or treated as protected data. Enclave source code parameters may include, by way of non-limiting example, “#pragma txMaxThreads,”“#pragma tx VendorID,” a storage class-like specifier, or combinations thereof. An enclave-aware compiler may recognize that the “printf” function uses “i” and may generate semantics to convey a value corresponding to “i” to “printf” using a note 212 via the eABI 114:#pragma txMaxThreads 1#include <stdio.h>int main( ) { for ( private int i=0 ; i<10 ; i++ ) {  printf ( “%d\n”, i ); }}

[0207] In certain embodiments, generic source code 118 and enclave-aware source code 142 may overlap. For example, source code 188 may remain generic in the sense that it does not require SDK-specific enclave constructs, SDK-specific APIs, SDK-specific lifecycle calls, or SDK-specific interface definition artifacts, while also being enclave-aware in the sense that it includes compiler-recognizable annotations, parameters, qualifiers, attributes, pragmas, storage class-like specifiers, command line responsive constructs, or other source-level information associated with enclave-aware compilation. Accordingly, the distinction between generic source code and enclave-aware source code may depend upon the extent to which enclave-related semantics are expressed in the source code itself, supplied through compiler options or metadata, or introduced automatically during compilation. This overlap may allow ordinary software to receive enclave-aware treatment through incremental source-level guidance, compiler configuration, eABI metadata 246, policy, or combinations thereof without requiring a specialized enclave SDK workflow (FIG. 18).

[0208] In contrast, a PHOSITA would recognize that SDK-aware source code 332 (FIGS. 18 and 24A-C) generally differs from generic source code 118 (FIGS. 8-9) and enclave-aware source code 142 (FIG. 46) because SDK-aware source code introduces enclave 104 semantics through programmer-authored SDK-specific constructs rather than through compiler-directed translation of ordinary source code 188 constructs. Such SDK-aware source code may require explicit enclave lifecycle calls, enclave entry point declarations, enclave interface definition files, specialized build workflows, SDK-generated source files, or separately managed enclave artifacts. By comparison, enclave-aware source code may provide compiler-recognizable guidance regarding protected placement, sharing, symbol access, threading, note 212 formation, or execution environment treatment without requiring the programmer to manually implement enclave creation, enclave destruction, ECALL / OCALL interfaces, or SDK-specific enclave management. In certain embodiments, an enclave-aware compiler 122 may use such guidance to generate executable files 190, protected sections 156, unprotected sections 154, eABI 114 semantics, data security mode 130 information, certificate 168 information, kernel-resident enclave 402 interoperability information, kernel-resident trusted execution environment 416 interoperability information, or combinations thereof.

[0209] Unless otherwise specified, unqualified references to “source code”188 are not limited to generic source code 118 and do not exclude SDK-aware source code 332, enclave-aware source code 142, or combinations thereof.

[0210] “Function signature” refers to source code 188 information, function metadata 244, compiler-derived information, symbol information, type information, calling convention information, or combinations thereof associated with a function, procedure, method, subroutine, service, published symbol 194, external symbol, entry point 262, or other callable code portion. A function signature may include a function name, symbol name, function identifier, symbol identifier, function hash, symbol hash, external symbol dependency 184, published symbol, return type, return datatype, argument count, argument order, argument names, parameter names, argument datatypes, parameter datatypes, pointer or reference type information, const qualification, calling convention, variadic-function information, or combinations thereof. A function signature may be used by an enclave-aware compiler 122 to support symbol resolution, note formation, control transfer, data exchange, argument handling, return handling, or interoperability according to an eABI.

[0211] In certain embodiments, a function call in source code 188 may be associated with a function signature. The function signature may identify a called function, published symbol 194, imported symbol, external symbol dependency 184, entry point 262, service, functionality, or data associated with a symbol, or combinations thereof. The function signature may further identify argument type information, argument order information, return-type information, calling convention information, variadic-function information, or combinations thereof used by an enclave-aware compiler 122 to generate processor instructions 120, eABI metadata 246, note formation semantics, symbol metadata, argument payload 318 information, referenced-data payload 350 information, return payload 352 information, or combinations thereof. The generated information may support conveying function call arguments, referenced data, return values, status information, or combinations thereof across execution environment boundaries according to an eABI (FIG. 50).

[0212] When generic source code 118 (FIG. 9) includes a function call associated with a function signature, an enclave-aware compiler 122 may derive argument and return information and generate processor instructions 120, eABI metadata 246, note formation semantics, and, when applicable, copying or descriptor information. The generated information may cause a loaded executable 364 to form an outbound note 290 containing an argument payload 318, referenced-data payload 350, return-related information, routing information, and selected data security mode information according to the eABI 114.

[0213] Information derived from a function signature may be distributed between a routable envelope 272 and a protected payload 276. The envelope may expose information sufficient for routing, logging, policy evaluation, or transit buffer handling, while the protected payload may contain symbol, function signature, argument, referenced-data, return, or cryptographic information protected from interpretation outside an authorized execution environment.

[0214] In certain embodiments, generic source code 118 may include a function call written without an enclave-specific interface definition language, enclave-specific call declaration, manually written enclave transition wrapper, explicit marshaling, or combinations thereof. An enclave-aware compiler 122 may infer, derive, or determine function signature information and argument payload 318 information from the generic source code and may generate processor instructions 120, metadata 244, note formation semantics, or combinations thereof for conveying the corresponding function call arguments 362 across an execution environment boundary according to the eABI 114 (FIG. 50). The execution environment boundary may be between common memory 166 and a trusted execution environment 326, between enclaves 104, between a usermode process 150 and a kernel-resident enclave 402, between a loaded eABI-common executable 250 and a loaded enclave-aware executable 268, or combinations thereof.Compiler

[0215] Certain terms are used herein to describe compilers associated with the execution architectures disclosed in the present application. Unless otherwise specified, the term “compiler” is used in a generic sense and may refer to a traditional compiler 330, enclave-aware compiler 122, or another compiler variant (FIGS. 4-5). A compiler may include a single compiler program, a compiler driver, a compiler toolchain, a linker, an assembler, a metadata-generation tool, a code signing tool, a certificate insertion tool, a post-link processing tool, a build tool, or combinations thereof, unless the context indicates otherwise.

[0216] “Compiler” (FIGS. 4-5) refers generally to software configured to translate source code 188 into executables 110 suitable for execution by a processor 106. A compiler may perform one or more operations including lexical analysis, syntax analysis, semantic analysis, intermediate representation generation, optimization, code generation, linking, or combinations thereof. A compiler may generate object files, executables, libraries 328, intermediate representations, metadata 244, processor instructions 120, section information, symbol information, certificate information, or other compilation outputs. These files may be linked together at a later time to create a final executable file 190 that may conform to specified interoperability standards such as an ABI. A compiler may operate on generic source code 118, SDK-aware source code 332, enclave-aware source code 142, or combinations thereof.

[0217] A “traditional compiler”330 (FIGS. 4-5) refers to a compiler configured to translate generic source code 118 (FIGS. 8-9, 11, and 14) into traditional executables 334 that operate according to a traditional Application Binary Interface (ABI) 342 and execute in common memory 166 within a common virtual address space 220. A PHOSITA would understand that traditional compilers may generate executables intended to execute in common memory without regard to enclave-based isolation technologies. Traditional compilers typically assume that executable components such as applications and libraries 328 interoperate through direct calls, common memory, and conventional ABI-defined calling conventions. A traditional compiler may generate a traditional executable file 234 or traditional executable that can be loaded by a traditional loader 336 into common memory, but need not generate protected sections 156, eABI metadata 246, note formation semantics 370, candidate data security modes 372, enclave-compatible cryptographic keys 170, or other structures configured to support eABI-governed interoperability across trusted execution environments 326.

[0218] An “enclave-aware compiler”122 (FIGS. 4-5 and 31) refers to a compiler configured to translate source code 188 into an eABI-aware executable 112 capable of interoperating according to an enclave-aware Application Binary Interface (eABI) 114. An enclave-aware compiler may be configured to produce enclave-aware executables 126 capable of being loaded, in whole or in part, into trusted execution environments (TEEs) 326 such as enclaves 104.

[0219] An enclave-aware compiler may generate executables 110 configured to operate in common memory 166, within a trusted execution environment 326, within an enclave 104, within a kernel-resident enclave 402, within a kernel-resident trusted execution environment 416, or combinations thereof, while using an eABI for control transfer or data exchange between loaded executables 364 in different execution environments.

[0220] An enclave-aware compiler may generate an eABI-kernel executable configured to be loaded into a kernel-resident enclave 402, a kernel-resident trusted execution environment 416, or combinations thereof, while using an eABI for control transfer or data exchange between loaded executables 364 in different execution environments.

[0221] For a particular executable role, the enclave-aware compiler 122 may produce a single enclave-aware executable file 264 corresponding to that executable. For example, generic main source code 236 may produce a first executable file corresponding to a main executable 278, and generic library source code 274 may separately produce a second executable file corresponding to a library executable 284 (FIG. 31). In this context, “single” means one executable file for the respective executable and does not require all executables of a usermode process 150 to be combined in one file.

[0222] An enclave-aware compiler 122 may generate an eABI-aware executable file 238 including sections 152, processor instructions 120, eABI metadata 246, external symbol dependencies 184, published symbols 194, note formation semantics 370, candidate data security modes 372, note-ingest / dispatch-capability 368, return semantics, certificate information, or combinations thereof. After at least a portion of the eABI-aware executable file is loaded into memory 108 to form a loaded eABI-aware executable 240, the loaded eABI-aware executable may interoperate with one or more loaded executables 364 according to the eABI 114.

[0223] An enclave-aware compiler 122 may translate restricted source code 206 into an eABI-common executable file 248 configured to be loaded into common memory 166 (FIG. 35). After loading, the resulting loaded eABI-common executable 250 may perform one or more restricted operations and may return result information according to the eABI 114.

[0224] In certain embodiments, an enclave-aware compiler 122 may include one or more components of a compilation toolchain configured to produce an eABI-aware executable 112 or an enclave-aware executable file 264. Such components may include a compiler frontend, compiler backend, assembler, linker, loader preparation tool, metadata generator, section generation tool, relocation processor, symbol table processor, code signing tool, certificate insertion tool, post-link processing tool, compiler driver, build tool, or combinations thereof. Accordingly, an operation described as being performed by an enclave-aware compiler may be performed by a single compiler program, by a compiler driver invoking multiple toolchain components, by a linker or post-link tool operating after compilation, or by another toolchain component configured to produce, modify, sign, or finalize an eABI-aware executable. The enclave-aware compiler may therefore represent a compiler stage, link stage, post-link stage, signing stage, packaging stage, or build system stage implementation of eABI 114 support.

[0225] An enclave-aware compiler 122 may derive function signature information and use the derived information to generate eABI metadata 246 and processor instructions 120 defining argument representations, referenced-data representations, return representations, note-layout information, and argument-implied sharing for eABI-governed control transfer or data exchange (FIG. 50). An enclave-aware compiler may determine that the programmer intends to share a variable or an argument with another enclave without sharing that same argument with other enclaves or executables running in common memory (FIG. 52).

[0226] When generic source code 118 includes an external symbol dependency 184, the enclave-aware compiler 122 may generate eABI metadata 246, processor instructions 120, symbol information, note-formation information, candidate data security modes 372, and dispatch information for use, after loading, in resolving the external symbol dependency and invoking a corresponding published symbol 194.

[0227] When generic source code 118 includes a published symbol 194, the enclave-aware compiler 122 may generate eABI metadata 246, processor instructions 120, entry point information, validation information, and candidate data security modes 372 that identify the published symbol and one or more defined entry points and restrict external access or control transfer to a defined entry point.

[0228] The enclave-aware compiler 122 may be configured to produce executables 110 that are backward compatible with traditional executables 334. The enclave-aware compiler may also include options for targeting alternate hardware architectures and alternate ABIs where the alternate system uses alternative trusted execution environments 326. In certain embodiments, the enclave-aware compiler may preserve selected traditional ABI 342 behavior for intra-executable calls or common memory calls while adding eABI-governed semantics for calls, data transfers, restricted instruction execution, symbol access, or note 212 processing involving different execution environments.

[0229] The enclave-aware compiler may introduce enclave semantics during compilation of generic source code 118 (FIGS. 8-9, 15, 31, and 46), enclave-aware source code 142, or combinations thereof, and may generate protected sections 156, unprotected sections 154, enclave-aware instructions 128, eABI metadata 246, external symbol dependencies 184, published symbols 194, note formation semantics 370, candidate data security modes 372, note-ingest / dispatch-capability 368, return semantics, certificate 168 information, cryptographic signature 228 information, or combinations thereof.

[0230] In certain embodiments, for a particular executable 110, the enclave-aware compiler 122 may apply a default placement rule (FIGS. 45 and 52) under which each text section 152 generated from generic source code 118 for the particular executable is designated for placement in a trusted execution environment 326 (FIG. 48). The enclave-aware compiler may designate a generated text section as an unprotected text section 162 for placement in common memory 166 when the generic source code, an enclave source code parameter 144, an enclave command line parameter 140, a policy, a section attribute, or another compiler input expressly indicates common memory placement for the text section or corresponding source code (FIGS. 46-47). The enclave-aware compiler may also exclude from the default placement rule a text section generated from restricted source code 206 corresponding to a restricted operation that requires, invokes, or compiles into a restricted instruction 204, and may translate the restricted source code into an eABI-common executable file 248 (FIG. 35). The enclave-aware compiler may generate eABI metadata 246, section attributes, or both identifying a target execution environment for each generated text section.

[0231] In certain embodiments, the default placement rule applies to each section generated from source code for a particular executable, including text sections, data sections, metadata sections, and other loadable sections. Each such section is designated for placement in a trusted execution environment unless the source code, a compiler input, a section attribute, a policy, or eABI metadata expressly designates the section for common memory placement, or the section is generated from restricted source code corresponding to an operation that is to execute outside the trusted execution environment. The enclave-aware compiler generates eABI metadata, section attributes, or both identifying the selected target execution environment for each generated section.

[0232] An enclave-aware compiler 122 or another toolchain component may generate, insert, or associate a certificate 168, certificate chain 388, cryptographic signature 228, enclave-compatible-key information, signed-section information, or other trust information with an executable file 190 or protected section 156 for use in governed loading (FIG. 53), initialization, registration, or eABI participation.

[0233] An enclave-aware compiler 122 may receive one or more enclave command line parameters 140 (FIG. 48) that select or constrain an output type, target execution environment, default data-placement rule, section-placement rule, note formation behavior, candidate data security modes 372, production mode or signing requirement, debug or vendor setting, enclave stack or heap size, maximum thread count, kernel-resident-TEE treatment, or other compilation setting. The compiler may generate corresponding executable sections, eABI metadata 246, processor instructions 120, certificate or signature information, and configuration information.

[0234] An enclave-aware compiler 122 need not execute on an enclave-aware processor 124. For example, the enclave-aware compiler may execute on a development system, build server, traditional processor 324, virtualized build environment, or other computing environment while generating enclave-aware executables 126 configured to execute on, be loaded for, or interoperate with an enclave-aware processor, trusted execution environment 326, enclave 104, kernel-resident enclave 402, kernel-resident trusted execution environment 416, alternate hardware architecture, alternate eABI, or combinations thereof.

[0235] Unless otherwise specified, unqualified references to “compiler” are not limited to traditional compilers 330 and may include an enclave-aware compiler 122, compiler frontend, compiler backend, assembler, linker, code signing tool, build tool, or combinations thereof.

[0236] “Enclave command line parameters”140 (FIG. 48) refer to command line options, compiler options, linker options, build parameters, toolchain parameters, configuration values, environment-derived values, policy values, or other configuration information received by an enclave-aware compiler 122, linker, metadata generator, signing tool, compiler driver, build system, or other toolchain component to influence enclave-aware compilation, eABI-aware compilation, executable generation, eABI metadata generation, section generation, signing, packaging, or combinations thereof. Unless otherwise specified, an enclave command line parameter need not be typed manually at a command line and may be supplied by a developer, build script, makefile, project file, linker script, configuration file, environment variable, policy file, integrated development environment, continuous integration system, operating system, deployment system, or other mechanism for conveying configuration information to a toolchain component.

[0237] In certain embodiments, an enclave command line parameter 140 may select, constrain, or configure an output type, target execution environment, trusted execution environment 326, enclave 104, kernel-resident enclave 402, kernel-resident trusted execution environment 416, common-memory placement, protected placement, default data-placement rule, section-placement rule, eABI-common executable 208 generation, restricted instruction 204 handling, enclave-aware storage class 270, data security mode 130, note 212 formation behavior, note routing behavior, symbol publication behavior, external symbol dependency 184 behavior, entry point 262 behavior, thread of execution 224 behavior, memory allocation, stack size, heap size, maximum thread count, debug mode setting, vendor identifier, processor target, alternate eABI, certificate 168 information, cryptographic signature 228 information, enclave-compatible cryptographic key 170 information, production mode 174 requirement, governed launch requirement, kernel-resident-TEE interoperability treatment, or combinations thereof.

[0238] In response to an enclave command line parameter 140, the enclave-aware toolchain may generate, modify, insert, associate, select, or omit processor instructions 120, enclave-aware instructions 128, eABI metadata 246, section or segment attributes, target execution environment information 266, symbol information, relocation information, note formation information, candidate data security modes 372, certificate information, signature information, kernel note information, configuration information, or combinations thereof. The generated information may be used by an enclave-aware loader 146, eABI-aware runtime 180, loaded executable 364, operating system 148, hypervisor 226, trusted execution environment 326, or combinations thereof during placement, loading, initialization, validation, attestation, governed launch, dispatch, routing, delivery, return processing, restricted-operation handling, symbol resolution, or eABI-governed interoperability.

[0239] Enclave command line parameters 140 may provide enclave-aware behavior without requiring SDK-aware source code 332 (FIGS. 24A-C), an enclave-specific interface definition, an explicit enclave lifecycle call, a manually written enclave-transition wrapper, or explicit marshaling code in source code 188. An enclave command line parameter may supplement, constrain, or override a compiler default setting, build system setting, project configuration setting, enclave-aware source code parameter 144, eABI metadata 246, policy, trust status, runtime configuration, or combinations thereof when producing an eABI-aware executable file 238, enclave-aware executable file 264, eABI-common executable file 248, or other eABI-aware, enclave-aware, or eABI-common executable. For example, the parameter may indicate whether a global variable, local variable, function, object, section 152, published symbol 194, external symbol dependency 184, restricted source code portion, or restricted instruction source code portion is to receive protected placement, unprotected placement, note-mediated transfer, eABI-common executable treatment, enclave-aware treatment, signing treatment, certificate preparation, candidate data security mode treatment, kernel-resident enclave interoperability treatment, kernel-resident trusted execution environment interoperability treatment, or combinations thereof.Executables

[0240] The terms described in this section may identify different aspects of an executable 110, including a lifecycle state, execution environment, interoperability capability, or program role. For example, an executable may be an executable file 190 before loading and a loaded executable 364 after loading; may be eABI-aware, enclave-aware, eABI-common, traditional, or combinations thereof; and may operate as a main executable 278, library executable 284, operating system 148 kernel, or combinations thereof unless the context indicates otherwise.

[0241] An “executable”110 (FIG. 6) refers generally to a computer-readable executable configured for loading into memory 108, execution by a processor 106, or interoperation with other executables. An executable may include processor instructions 120, data, headers, metadata 244, sections 152, segments, pages, functions, segment tables, symbol information, relocation information, certificates 168, cryptographic signatures 228, cryptographic material, or combinations thereof. Executables may be produced or represented as a standalone binary, shared library, shared object, dynamic library, dynamically linked library, statically linked module, object file, executable image, kernel module, firmware, or combinations thereof.

[0242] An executable may be created by a compiler (FIG. 11), interoperate according to an ABI, be analyzed by a loader, execute through a runtime, cooperate with a runtime, or combinations thereof. Accordingly, an executable may have a publisher or an entity responsible for the creation and distribution of the executable.

[0243] An “executable file”190 refers to an executable 110 as stored in a non-transitory computer-readable medium 346 (FIG. 16). For example, a compiler may create an executable file from source code 188.

[0244] A “loaded executable”364 refers to an in-memory executable instance, executable image, executable portion, or execution-ready representation formed from at least a portion of an executable file 190 after the portion has been loaded, mapped, copied, relocated, linked, instantiated, initialized, or otherwise prepared for execution in memory 108 (FIG. 16).

[0245] An executable 110 may initiate eABI-governed access to functionality or data through an external symbol dependency 184 that is resolved to a published symbol 194 and a corresponding defined entry point 262 (FIG. 12).

[0246] An enclave-aware loader 146 may obtain dependent executable files (FIG. 23), analyze their eABI metadata 246, resolve or assist in resolving external symbol dependencies 184, and generate or make available symbol resolution information identifying a loaded executable 364, execution environment, published symbol 194, and defined entry point 262.

[0247] An eABI-aware runtime 180 may use published-symbol, external-dependency, and symbol resolution information to dispatch, route, or deliver notes 212 (FIGS. 33-34), enforce controlled entry, and facilitate return processing between loaded executables 364.

[0248] A “main executable”278 (FIGS. 9, 22-23, and 37) refers to an executable 110 configured to initiate, launch, or establish a usermode process 150. In certain embodiments, a main executable may include an entry point 262 configured to be called by an entry / exit bootstrap module 288, loader, runtime, thread of execution 224, or combinations thereof.

[0249] A “library executable”284 (FIGS. 10 and 23) refers to an executable 110 configured to provide one or more published symbols 194, services, functions, data, or interfaces that satisfy external symbol dependencies 184 of other executables. A library executable may be implemented as a shared library, shared object, dynamic library, static library, dynamic link library, or combinations thereof.

[0250] A “traditional executable”334 (FIGS. 6, 14, 16, and 21) refers generally to an executable 110 configured to execute within common memory 166 according to a traditional Application Binary Interface (ABI) 342.

[0251] A “traditional executable file”234 may be loaded by a traditional loader 336 into common memory 166 to form a “loaded traditional executable”192 (FIG. 21). Traditional executables 334 typically assume that the executables loaded into a common virtual address space 220 execute with mutual visibility and trust, and interoperate through direct calls, shared memory, and traditional ABI 342-defined calling conventions (FIGS. 49A-B).

[0252] A PHOSITA would understand that traditional executables 334 formed from generic source code 118 (FIGS. 8-9) by a traditional compiler 330 are not typically generated with compiler-introduced eABI metadata 246 or inter-trusted execution environment 326 interoperability semantics such as protected sections 156, note formation semantics 370, or candidate data security modes 372 configured to support eABI-mediated interoperability (FIG. 11).

[0253] An “eABI-aware executable”112 (FIGS. 6, 16, and 53) refers to an executable 110 configured to support interoperability according to an enclave-aware Application Binary Interface (eABI) 114 (FIGS. 1 and 49A-B). An eABI-aware executable may be loaded into common memory 166, a trusted execution environment 326, an enclave 104, a kernel-resident enclave 402, a kernel-resident trusted execution environment 416, or combinations thereof.

[0254] The eABI-aware executable 112 may also include eABI metadata 246 and inter-execution environment interoperability semantics not required by a traditional executable 334 for eABI-enabled interoperability. Inter-trusted execution environment interoperability semantics may include note formation semantics 370, candidate data security modes 372, note ingestion semantics, controlled entry point semantics, note dispatch semantics, routable envelope 272 semantics, protected payload 276 semantics, return semantics, restricted instruction call semantics, or combinations thereof.

[0255] In certain embodiments, an eABI-aware executable 112 may include processor instructions 120 generated by an enclave-aware compiler 122 that cause a loaded executable 364 to form, populate, protect, transmit, receive, validate, decrypt, or process a note 212 according to the eABI 114 during execution.

[0256] Accordingly, an eABI-aware executable 112 may carry eABI metadata 246 or binary-level interoperability information that enables an enclave-aware loader 146, eABI-aware runtime 180, entry / exit bootstrap module 288, loaded eABI-aware executable 240, trusted execution environment 326, eABI-common executable 208, kernel-resident enclave 402, kernel-resident trusted execution environment 416, or combinations thereof to support control transfer or data exchange between loaded executables 364 in different execution environments, whereas a traditional executable 334 generally relies on traditional ABI 342-defined direct calls and common memory 166 symbol access.

[0257] An eABI-aware executable 112 may support access to a kernel-resident trusted execution environment 416, isolated kernel code 418, an isolated kernel resource 412, or a kernel service interface 414 by forming or processing a syscall note 306 or kernel note 410 according to the eABI 114.

[0258] An “eABI-aware executable file”238 refers to an eABI-aware executable 112 as stored in a non-transitory computer-readable medium 346 (FIG. 16). In certain embodiments, an enclave-aware compiler 122 may create an eABI-aware executable file from generic source code 118 (FIG. 31).

[0259] A “loaded eABI-aware executable”240 refers to an in-memory executable instance, executable image, executable portion, or execution-ready representation formed from at least a portion of an eABI-aware executable file 238 after the portion has been loaded, mapped, copied, relocated, linked, instantiated, initialized, or otherwise prepared for execution in memory 108 (FIG. 16). A loaded eABI-aware executable may be formed from all of an eABI-aware executable file or a portion of an eABI-aware executable file.

[0260] An eABI-aware executable 112 may perform a control transfer or data exchange 312 between loaded eABI-aware executables 240 in different execution environments using notes 212. Notes may be used to convey arguments, referenced data, return values, requests, responses, or other data exchange associated with processor instructions 120, data, services, functions, or published interfaces through an external symbol dependency 184 resolved to a published symbol 194. An enclave-aware loader 146 may determine the type of execution environment into which the eABI-aware executable is to be loaded, the execution environments including common memory 166, a trusted execution environment 326, an enclave 104, or combinations thereof.

[0261] A loaded eABI-aware executable 240 may advertise, support, request, accept, maintain, or apply candidate data security modes 372 for a published symbol 194, external symbol dependency 184, note 212, control transfer, data exchange, return path, or other eABI operation. A selected data security mode 374 may be chosen from modes supported by the participating executables and permitted by applicable policy (FIG. 42), taking account of security, performance, trust, symbol-specific, or system requirements.

[0262] An “eABI-aware main executable”182 refers to an eABI-aware executable 112 having a main-executable role. In certain embodiments, an eABI-aware main executable may initiate, launch, or establish a usermode process 150, may include an entry point 262, and may interoperate with one or more other loaded executables 364 according to the eABI 114. A loaded eABI-aware main executable refers to an in-memory instance, executable image, executable portion, or execution-ready representation of an eABI-aware main executable after loading.

[0263] An “eABI-aware library executable”186 refers to an eABI-aware executable 112 having a library-executable role. In certain embodiments, an eABI-aware library executable may provide one or more published symbols 194, services, functions, data, interfaces, or defined entry points 262 that satisfy external symbol dependencies 184 of one or more other executables according to the eABI 114. A loaded eABI-aware library executable refers to an in-memory instance, executable image, executable portion, or execution-ready representation of an eABI-aware library executable after loading.

[0264] An eABI-aware main executable 182 or eABI-aware library executable 186 may be implemented as, or may be included in, an enclave-aware executable 126, an eABI-common executable 208, a loaded eABI-aware executable 240, or a loaded enclave-aware executable 268 when the applicable subtype, lifecycle state, and execution environment are indicated by context.

[0265] “eABI metadata”246 is metadata 244 associated with an eABI-aware executable 112 and used to support interoperability according to the eABI 114. It may identify target execution environments and section placement; protected and unprotected sections; external symbol dependencies 184 and published symbols 194; candidate data security modes 372; eABI versions; trust, publisher, or provenance information; cryptographic support information; kernel-service or isolated-resource requests; function signature, note formation, controlled entry, return, or other eABI information; and combinations thereof.

[0266] “Target execution environment information”266 refers to eABI metadata 246, section information, section-placement information, segment attribute information, compiler-generated information, loader-readable information, policy information, or combinations thereof that identifies, requests, requires, constrains, or permits an execution environment into which a section 152, executable portion, processor instruction 120, data object, protected section 156, unprotected section 154, or combination thereof is to be loaded, mapped, provisioned, initialized, or executed. The target execution environment may include common memory 166, an enclave 104, a trusted execution environment 326, a kernel-resident enclave 402, a kernel-resident trusted execution environment 416, or combinations thereof. Target execution environment information may be generated by an enclave-aware compiler 122, linker, loader-preparation tool, metadata generator, policy component, or other toolchain component and may be used by an enclave-aware loader 146, eABI-aware runtime 180, operating system 148, trusted execution environment, or combinations thereof during loading, placement, initialization, registration, routing, validation, or execution.

[0267] An enclave-aware loader 146 may use eABI metadata 246 and target execution environment information 266 to determine whether a portion of an executable file 190 is loaded into common memory 166, a trusted execution environment 326, an enclave 104, a kernel-resident trusted execution environment 416, or another protected region, or is deferred or excluded from loading (FIG. 15).

[0268] An eABI-aware runtime 180 may use eABI metadata 246 and runtime information derived during loading, registration, symbol resolution, or execution to facilitate eABI-governed control transfer or data exchange. The runtime-derived information is not itself limited to metadata stored in an executable file (FIG. 53).

[0269] In contrast, traditional executable 334 metadata may not typically include metadata 244 identifying protected sections 156, candidate data security modes 372, note formation semantics 370, isolated kernel resource request information, or combinations thereof.

[0270] An “eABI-common executable”208 (FIGS. 6 and 31-32) refers to a specialized eABI-aware executable 112 configured to execute, in whole or in part, within common memory 166 while participating in eABI-mediated interoperability with one or more loaded eABI-aware executables 240, loaded enclave-aware executables 268, trusted execution environments 326, kernel-resident enclaves 402, kernel-resident trusted execution environments 416, or combinations thereof according to the eABI 114.

[0271] An “eABI-common executable file”248 refers to an eABI-common executable 208 (FIGS. 6 and 16) as stored in a non-transitory computer-readable medium 346. In certain embodiments, an enclave-aware compiler 122 may create an eABI-common executable file from generic source code 118 (FIGS. 8-9).

[0272] An “unprotected executable section” refers to an unprotected section 154 containing processor instructions 120 configured for execution in common memory 166. An unprotected executable section may comprise an “unprotected text section”162.

[0273] A “loaded eABI-common executable”250 refers to an in-memory executable instance, executable image, executable portion, or execution-ready representation formed from at least a portion of an eABI-common executable file 248 after the portion has been loaded, mapped, copied, relocated, linked, instantiated, initialized, or otherwise prepared for execution in common memory 166 (FIGS. 16 and 22).

[0274] A loaded eABI-common executable 250 may execute a restricted instruction 204 in common memory 166 on behalf of, or in response to a control transfer or data exchange from, a loaded enclave-aware executable 268, a kernel-resident enclave 402, or kernel-resident trusted execution environment 416 (FIG. 35). A loaded eABI-common executable may interoperate with one or more loaded eABI-aware executables 240 according to the eABI 114 using control transfer, data exchange, note 212 processing, or combinations thereof (FIGS. 22, 31-32, and 37).

[0275] In some embodiments, a loaded eABI-common executable 250 is treated as a loaded executable 364 governed by the eABI 114 for restricted instruction call semantics, symbol resolution semantics, dispatch semantics, data transfer semantics, and return semantics, even when the loaded eABI-common executable executes in common memory outside a trusted execution environment.

[0276] In certain embodiments, a loaded eABI-common executable 250 in common memory 166 may implement or provide a common memory service (FIGS. 22, 31-32, and 37) configured to perform one or more restricted operations in response to eABI-mediated requests from one or more loaded eABI-aware executables 240 (FIG. 35). The common memory service may provide operating system interface services, system call services, filesystem services, network services, memory management services, time services, processor-identification services, I / O services, standard library 282 services, isolated kernel resource 412 request services (FIG. 54), or combinations thereof.

[0277] An “enclave-aware executable”126 (FIG. 6) refers to a specialized eABI-aware executable 112 configured to support execution, in whole or in part, within a trusted execution environment 326 such as an enclave 104, while supporting interoperability with one or more loaded eABI-aware executables 240 according to the eABI 114.

[0278] Because an enclave-aware executable 126 is a specialized eABI-aware executable 112, features described herein for an eABI-aware executable may also be included in, used by, or performed by an enclave-aware executable unless the context indicates otherwise.

[0279] In certain embodiments, an enclave-aware executable 126 may include protected sections 156 and unprotected sections 154, where the protected sections are configured to be loaded into a trusted execution environment 326 and the unprotected sections are configured to be loaded into common memory 166 (FIG. 15).

[0280] Unlike a traditional executable 334, an enclave-aware executable 126 may include enclave-aware instructions 128, protected sections 156, eABI metadata 246 associated with the protected sections, eABI trust evidence 382, enclave-compatible cryptographic key 170, a certificate 168 associated with the enclave-compatible cryptographic key, candidate data security modes 372, entry point 262 information for controlled entry into a trusted execution environment 326, published symbol 194 metadata configured for controlled access from outside the trusted execution environment, external symbol dependency 184 metadata configured for access from inside the trusted execution environment, note formation semantics 370 for trusted execution environment boundary crossing, protected payload 276 semantics, semantics for sharing keys between trusted execution environments, restricted instruction 204 handling information or combinations thereof.

[0281] An “enclave-aware executable file”264 refers to an enclave-aware executable 126 as stored in a non-transitory computer-readable medium 346 (FIG. 16).

[0282] In certain embodiments, an enclave-aware executable file 264 may be produced by an enclave-aware compiler 122 from generic source code 118 (FIGS. 8-9) or enclave-aware source code 142 (FIG. 46). An enclave-aware executable file may be compiled on a processor 106 that is not itself configured to run the enclave-aware executable file, including through cross-compilation.

[0283] In certain embodiments, eABI trust evidence 382 may be generated, issued, inserted into, embedded in, appended to, digitally signed, or otherwise associated with an enclave-aware executable file 264 compiled from generic source code 118 by an enclave-aware compiler 122.

[0284] An enclave-aware loader 146 may analyze the enclave-aware executable file 264 (FIGS. 15-16 and 53) and determine, based on the target execution environment, whether each section or portion is to be loaded into the trusted execution environment 326, loaded into common memory 166, deferred, excluded from loading, or otherwise processed.

[0285] An enclave-aware loader 146 may extract, read, reference, validate, or otherwise access eABI trust evidence 382 from an enclave-aware executable file 264 before loading a protected section 156 into a trusted execution environment 326 such as an enclave 104, before initializing the trusted execution environment, or before permitting eABI-mediated control transfer or data exchange. The validation may determine whether the protected section is authorized for loading under the trust policy 386, production mode 174 state, trusted root set, certificate validity status, certificate usage constraint, revocation status, or combinations thereof.

[0286] In certain embodiments, a trust determination (FIG. 53) based on the eABI trust evidence 382, production mode 174, trusted root set, or combinations thereof may determine whether an enclave-aware executable file 264 is permitted to be loaded, publish symbols, satisfy external symbol dependencies 184, receive notes 212, send notes, participate in selected data security modes 374, or otherwise participate in eABI-mediated interoperability.

[0287] A “loaded enclave-aware executable”268 refers to an in-memory executable instance, executable image, executable portion, or execution-ready representation formed from at least a portion of an enclave-aware executable file 264 after the portion has been loaded, mapped, copied, relocated, linked, instantiated, initialized, or otherwise prepared for execution in a trusted execution environment 326 or enclave 104 (FIG. 16). A loaded enclave-aware executable may be formed from all of an enclave-aware executable file or a portion of an enclave-aware executable file.

[0288] A loaded enclave-aware executable 268 may be configured to interoperate with a loaded eABI-aware executable 240, a loaded eABI-common executable 250, another loaded enclave-aware executable, a loaded executable 364 in common memory 166, or combinations thereof according to the eABI 114. Such interoperability may include control transfer, data exchange, note 212 formation, note dispatch, return semantics, symbol resolution, validation, encryption, candidate or selected data security mode 374 processing, or combinations thereof.

[0289] Portions of a loaded enclave-aware executable 268 loaded into a trusted execution environment 326 may be isolated from common memory 166 and from other executable components, such that processor instructions 120 executing outside the trusted execution environment cannot directly access protected sections 156 or internal data structures contained therein (FIGS. 22, 31, and 43). In certain embodiments, protected portions of a loaded enclave-aware executable may be restricted from executing one or more restricted instructions 204 (FIG. 35).

[0290] A loaded enclave-aware executable 268 may expose only designated entry points 262 and may use signed or otherwise validated published-symbol and external-dependency information (FIGS. 12-13, 32, 50, and 53). Its interoperability with other loaded eABI-aware executables 240 may be mediated by symbol resolution, notes 212, controlled entry points, validation, and selected data security modes 374 according to the eABI 114.

[0291] In certain embodiments, a loaded eABI-aware executable 240, loaded eABI-common executable 250, loaded enclave-aware executable 268, or other loaded executable 364 may maintain, receive, determine, negotiate, or apply a selected data security mode 374 determined from a set of candidate data security modes 372 (FIG. 42). The selected data security mode may be maintained by a first loaded executable, a second loaded executable, or combinations thereof, and may be used by the loaded executable to process a control transfer, data exchange, note 212, protected payload 276, symbol access, or combinations thereof according to the eABI 114.

[0292] In one restricted operation embodiment, a loaded enclave-aware executable 268 has an external symbol dependency corresponding to a published symbol of a loaded eABI-common executable 250. Invocation causes the loaded enclave-aware executable to form and dispatch an outbound note, syscall note 306, or kernel note 410 having a routable envelope and authorized call data; the loaded eABI-common executable receives the request, performs the restricted operation in common memory 166, and forms a return note carrying result, status, error, return-value, or modified-data information according to the return semantics (FIG. 35).

[0293] An “untrusted enclave-aware executable file” may include an unsigned enclave-aware executable file, an enclave-aware executable file that does not satisfy the trust policy, or an enclave-aware executable file having a certificate chain that does not satisfy the trust policy (FIG. 53).

[0294] In certain embodiments, a loader may load an untrusted enclave-aware executable file forming a “loaded untrusted enclave-aware executable” when the production mode 174 is not in the active state 178 (FIG. 53). Furthermore, the eABI-aware runtime may be informed that the loaded untrusted enclave-aware executable is untrusted, development-only, unsigned, or has an invalid certificate chain, which may render the loaded untrusted enclave-aware executable ineligible to participate in certain eABI operations or access to certain data security modes 130.

[0295] Unless otherwise specified, an executable 110 may be traditional, eABI-aware, enclave-aware, or eABI-common; may have a main or library role; and may be an executable file 190 or a loaded executable 364. The applicable subtype and lifecycle state are determined from context, including whether the discussion concerns a stored executable file or an in-memory executable instance.Sections

[0296] A “section”152 (FIG. 28) may be a segment, protected section 156, an unprotected section 154, or another portion of an eABI-aware executable 112.

[0297] As used herein, the term “section” is used in a format-neutral sense to refer to a subdivision, region, block, or grouping of executable file content, object file content, binary image content, or in-memory executable image content. In different executable formats or loading models, such subdivisions may be referred to as segments, sections, loadable segments, program regions, memory mapped regions, or other file or memory regions. Unless expressly stated otherwise, a “section” may include an ELF section, an ELF segment, a PE section, or another executable format structure that groups, organizes, describes, loads, maps, protects, or otherwise manages code, data, metadata, or other executable content.

[0298] An “unprotected section”154 may be loaded into common memory 166. An “unprotected section” may include an “unprotected text section”162, “unprotected data section”164, or combinations thereof. An unprotected text section may include a restricted instruction 204 that may not run inside an enclave 104 or other trusted execution environment 326.

[0299] An eABI-common executable 208 may consist entirely of unprotected sections 154 loaded into common memory 166 and may perform restricted operations for one or more protected callers.

[0300] A “protected section”156 may be loaded into an enclave 104, trusted execution environment 326, kernel-resident enclave 402, kernel-resident trusted execution environment 416, or combinations thereof. The protected section may be digitally signed or otherwise associated with eABI trust evidence 382, including a certificate 168, cryptographic signature 228, enclave-compatible cryptographic key 170, or combinations thereof.

[0301] A protected section 156 may be generated by an enclave-aware compiler 122, linker, signing or certificate insertion tool, post-link tool, or build tool and may be loaded into a trusted execution environment 326, including a kernel-resident trusted execution environment 416. Protected sections may include protected text sections 158 and protected data sections 160 and may be associated with eABI trust evidence, measured or signed content, memory permissions, controlled entry, confidentiality, integrity, or authenticity protections.

[0302] A “protected data section”160 may be loaded into an enclave 104 or trusted execution environment 326 and may include data, eABI metadata 246, or eABI trust evidence, or combinations thereof, rather than processor instructions 120.

[0303] A “protected text section”158 is the code-bearing portion of a protected section 156 that is configured to be loaded into an enclave 104, trusted execution environment 326, kernel-resident enclave 402, kernel-resident trusted execution environment 416, or combination thereof. The protected text section includes processor instructions 120, enclave-aware instructions 128, or both for execution within the corresponding protected execution environment after loading and initialization.

[0304] In certain embodiments, a protected text section 158 may include compiler-generated processor instructions, entry-point code, note-formation code, dispatch code, delivery code, return-processing code, controlled-entry code, or other eABI-mediated interoperability instructions associated with eABI metadata 246.

[0305] In certain embodiments, section placement may be identified by eABI metadata 246, target execution environment information 266, section attributes, segment attributes, compiler-generated information, enclave command line parameters 140, enclave source code parameters 144, policy, or combinations thereof. An enclave-aware loader 146 may use the section placement information to determine whether a section is loaded into common memory 166, an enclave 104, a trusted execution environment 326, a kernel-resident enclave 402, a kernel-resident trusted execution environment 416, or combinations thereof.

[0306] A protected section does not imply that it is running in protected memory, a term that usually refers to kernel memory. The term protected section may imply that the section is configured to run in trusted execution environments or enclaves.Loader

[0307] Certain terms are used herein to describe program loading mechanisms associated with execution of compiled eABI-aware executables 112, traditional executables 334, or other executables 110. Unless otherwise specified, the term “loader” is used in a generic sense and may refer to traditional loaders 336, enclave-aware loaders 146, or other variants.

[0308] A “loader” (FIGS. 16-17) refers generally to software configured to load executable files 190 or portions thereof into memory 108 and prepare a computing environment for execution. A loader may perform one or more operations including analyzing executable files, mapping segments or sections 152 into memory, resolving dependencies, loading shared libraries, initializing runtime components, establishing a common virtual address space 220, creating a thread of execution 224, and transferring control to an entry point 262 of an executable 110. A loader may operate in conjunction with an operating system 148, runtime, loaded executable 364, standard library 282, firmware component, bootloader, hypervisor 226, or combinations thereof.

[0309] A “traditional loader”336 (FIGS. 14, 16, and 21) refers to a loader configured to load traditional executables 334 and associated traditional libraries into common memory 166 according to a traditional Application Binary Interface (ABI) 342. A traditional loader typically supports executable components that execute in common memory and interoperate through direct calls and shared memory. Traditional loaders may recursively resolve shared library dependencies (FIG. 23), map sections 152 into a common virtual address space 220, and initialize a traditional runtime 338 prior to execution. Traditional loaders are not typically configured to instantiate trusted execution environments (TEEs) 326 such as enclaves 104, load protected sections 156 into TEEs, or evaluate eABI trust evidence 382 as a condition for trusted execution of executables compiled from generic source code 118.

[0310] An “enclave-aware loader”146 (FIGS. 15-17, 37, and 53) refers to a loader configured to support execution within an eABI-aware architecture. The enclave-aware loader may analyze eABI-aware executable files 238, eABI metadata 246, eABI trust evidence 382, or combinations thereof. The enclave-aware loader may identify protected sections 156 and unprotected sections 154, create one or more enclaves 104 or trusted execution environments 326, load protected sections into a trusted execution environment, load unprotected sections into common memory 166, initialize execution environments, and load or initialize an eABI-aware runtime 180, entry / exit bootstrap module 288, or combinations thereof.

[0311] In certain embodiments, the enclave-aware loader 146 may instantiate, request, provision, or configure a usermode process 150 including a common virtual address space 220. The enclave-aware loader may provision the usermode process to interoperate with one or more enclaves 104, trusted execution environments 326, eABI-aware executables 112, enclave-aware executables 126, eABI-common executables 208, or combinations thereof. The enclave-aware loader may further initialize an eABI-aware runtime 180 or entry / exit bootstrap module 288 and prepare loaded executables 364 for interoperability according to an enclave-aware Application Binary Interface (eABI) 114.

[0312] An enclave-aware loader 146 may load an eABI-common executable file 248 or an unprotected executable portion into common memory 166 to form a loaded eABI-common executable 250.

[0313] The enclave-aware loader 146 may interpret executable structures generated by a compiler, linker, signing tool, certificate insertion tool, metadata generator, post-link tool, or build tool. The structures may include eABI metadata 246, section or segment attributes, target execution environment information 266, protected or unprotected section indicators, candidate data security modes 372, and eABI trust evidence 382, which the loader uses to place executable portions in common memory 166, trusted execution environments 326, kernel-resident trusted execution environments 416, or combinations thereof.

[0314] The enclave-aware loader 146 may load at least a portion of one or more protected sections 156, including a protected text section 158, protected data section 160, or both, into an enclave 104 or trusted execution environment 326. The enclave-aware loader may also load at least a portion of one or more unprotected sections 154, including an unprotected text section 162, unprotected data section 164, or both, into common memory 166.

[0315] In certain embodiments, the enclave-aware loader 146 may manage, request, coordinate, or validate enclave 104 lifecycle operations including enclave creation, initialization, provisioning, measurement, attestation, key association, and association with loaded eABI-aware executables 240. The enclave-aware loader may coordinate with an enclave-aware processor 124, operating system 148, hypervisor 226, firmware component, kernel component, eABI-aware runtime 180, or combinations thereof to enforce memory isolation, execution constraints, restricted instruction 204 constraints, controlled entry point semantics, or combinations thereof.

[0316] In an embodiment using a first enclave-aware executable file and a second enclave-aware executable file with respective first and second trusted execution environments, the enclave-aware loader loads protected sections originating from the first enclave-aware executable file only into the first trusted execution environment and loads protected sections originating from the second enclave-aware executable file only into the second trusted execution environment. Accordingly, the first trusted execution environment contains no protected section loaded from the second enclave-aware executable file, and the second trusted execution environment contains no protected section loaded from the first enclave-aware executable file. After loading, the enclave-aware loader transitions each trusted execution environment to an execution-ready state, identifies a defined initialization entry point for each loaded executable from eABI metadata, and causes the respective initialization code to execute only through the corresponding defined initialization entry point.

[0317] The enclave-aware loader 146 may verify that an enclave 104 or trusted execution environment 326 is initialized using an enclave-compatible cryptographic key 170 associated with certificate information, a certificate chain 388, or other eABI trust evidence 382 (FIG. 53). When production mode 174 is active, the loader may require the applicable signature, key binding, trusted root, certificate validation result 378, provenance information 380, and trust policy conditions to permit loading, initialization, registration, or eABI-mediated interoperability.

[0318] Loader validation may include checking executable headers and sections for tampering or alterations; accessing a certificate 168, certificate chain 388, signature 228, public or enclave-compatible key, trusted root information, provenance information 380, and certificate validation information; and verifying signatures, validity periods, usage constraints, policy constraints, integrity, revocation, trusted root status, and section correspondence. If production policy is not satisfied, the loader may prevent or restrict loading, initialization, registration, control transfer, or data exchange and record or report a trust status. When production mode is inactive, the loader may permit an unsigned or non-production executable for development use while recording an untrusted, development-only, or restricted status.

[0319] The enclave-aware loader 146 may recursively identify, analyze, load, defer, or initialize dependent executable files (FIG. 23); resolve or assist in resolving external symbol dependencies 184 to published symbols 194; and make symbol resolution information available to loaded executables 364, the eABI-aware runtime 180, or trusted execution environments 326. The loading sub-process may be performed for each newly loaded executable, including an executable obtained on demand or by lazy loading.

[0320] For each of a plurality of enclave-aware executable files 264 having respective protected sections 156 and eABI trust evidence 382, the enclave-aware loader 146 may separately validate the evidence, generate a respective trust determination, and apply separate loading, initialization, and registration permissions. A protected section is loaded into its corresponding trusted execution environment 326, initialized, and registered only when the applicable permission permits the operation; at least two of the corresponding trusted execution environments may be different.

[0321] The enclave-aware loader 146 may start (FIGS. 32 and 37), request startup of, or participate in startup of a usermode process 150 and may cooperate with the eABI-aware runtime 180 or entry / exit bootstrap module 288 to load, resolve, initialize, or dispatch to unloaded dependent executables 280 on demand, lazily, at startup, during initialization, during symbol resolution, or combinations thereof.

[0322] The enclave-aware loader 146 may be implemented within, invoked by, or distributed across one or more system components, including an operating system 148, eABI-aware runtime 180, hypervisor 226, standard library 282, firmware component, bootloader, kernel component, dynamic linker, executable launcher, entry / exit bootstrap module 288, trusted execution environment 326, or combinations thereof.

[0323] In the architecture described herein, an “eABI-aware loader” need not be provided as a distinct category of loader. Loading an eABI-aware executable 112 only into common memory 166 may, in some cases, resemble traditional loading behavior. By contrast, an enclave-aware loader 146 may provide additional functionality associated with trusted execution environments 326, including protected section 156 loading, enclave 104 creation, governed launch, eABI trust evidence 382 validation, execution environment selection, or combinations thereof.

[0324] eABI runtime functionality may be implemented by a separately loaded eABI-aware runtime 180 or by runtime support code introduced into one or more executable files by an enclave-aware compiler 122. In some embodiments, the eABI-aware runtime may be implemented as a runtime library, shared object, service, loader-associated component, operating-system component, common memory component, or trusted execution environment component. In addition, or alternatively, runtime support code may be generated, linked, inserted, or otherwise associated with each eABI-aware executable file 238, enclave-aware executable file 264, or eABI-common executable file 248, including within protected sections 156, unprotected sections 154, or both, so that the corresponding loaded executable 364 includes toolchain-introduced code for eABI-mediated interoperability. Such runtime support code is not application code manually written by a developer to implement enclave-specific interfaces, explicit enclave lifecycle calls, manually written enclave-transition wrappers, or explicit marshaling code; rather, the code may be introduced by the toolchain to support execution-environment setup, symbol resolution, note formation, dispatch, routing cooperation, delivery, return processing, policy enforcement, restricted-operation handling, data-security-mode processing, or other eABI operations.

[0325] The enclave-aware loader 146 may prepare and validate execution environments and executable portions and may make runtime information available to the separately loaded runtime component, the toolchain-introduced runtime support code in the loaded executables, or both.

[0326] During loading, initialization, or registration, the enclave-aware loader 146 may make available published-symbol, external-dependency, candidate- or selected-data security mode status, trust determination, certificate validation, provenance, and eABI trust evidence 382 information. The information may be associated with an executable file 190, loaded executable 364, symbol, dependency, note 212, payload, envelope, control transfer, data exchange, or execution environment and may be provided to loaded executables, runtime components, or trusted execution environments.

[0327] Unless otherwise specified, “loader” may refer to a traditional loader 336 or an enclave-aware loader 146.Runtime

[0328] The terms “runtime,”“C runtime,” and “CRT” may refer to traditional runtimes 338, eABI-aware runtimes 180, or other runtime variants unless context requires a particular subtype.

[0329] A “runtime” (FIG. 40) is software supporting execution of compiled executables 110. It may provide program initialization, memory and thread management, input / output, exception handling, symbol resolution, dispatch, return handling, cleanup, operating system interfacing, or combinations thereof and may be implemented by one or more libraries 328, modules, or loaded executables 364.

[0330] A “traditional runtime”338 (FIG. 21) supports traditional executables 334 in common memory 166 of a common virtual address space 220 under a traditional ABI, ordinarily using direct calls, shared memory, and traditional calling conventions.

[0331] A traditional runtime 338 need not provide eABI-mediated interoperability across trusted execution environment boundaries or mediate control transfer or data exchange between protected and unprotected execution environments.

[0332] An “eABI-aware runtime”180 (FIGS. 22, 29, 31-36, 40, and 53) supports interoperability among loaded eABI-aware, enclave-aware, eABI-common, and kernel-associated executable components according to the eABI 114. It may initialize runtime state; use runtime-derived information; assist symbol resolution; support dispatch, routing, delivery, return processing, data transfer, policy enforcement, and data security mode selection; or cause another routing mechanism to perform routing.

[0333] An eABI-aware runtime 180 may execute wholly or partly in common memory 166, in a trusted execution environment 326, in executable-side components, or across multiple environments. It may apply eABI-defined binary-level semantics while preserving the protections of the participating execution environments.

[0334] An eABI-aware runtime 180 may cooperate with an entry / exit bootstrap module 288, enclave-aware loader 146, operating system 148, policy component, certificate validation component, or production mode mechanism. It may use runtime information including trust determinations, certificate validation results 378, provenance information 380, production mode state, policy constraints, and data security mode constraints when permitting or processing eABI operations.

[0335] The eABI-aware runtime 180 may be loaded, initialized, invoked, or made available by an enclave-aware loader 146, operating system 148, entry / exit bootstrap module 288, loaded executable 364, or combination thereof (FIG. 37).

[0336] An eABI-aware runtime 180 or one of its components may publish or depend on symbols and may participate in resolving an external symbol dependency 184 to a compatible published symbol 194 according to the eABI 114.

[0337] The enclave-aware loader 146, eABI-aware runtime 180, loaded executable 364, or combination thereof may resolve, assist in resolving, or use runtime information derived from resolving an external symbol dependency 184 to a published symbol 194.

[0338] An eABI-aware runtime 180 may include executables, libraries 328, initialization or cleanup code, dispatch or note-processing code, and other runtime modules. It may provide stack, heap, global-state, entry point, memory, I / O, operating system, system call, and return-processing services.

[0339] A loaded executable 364 may form a note 212 that runtime components relay or route toward another loaded executable according to the eABI 114 (FIGS. 33-34). Executable-side components may perform dispatch and delivery while an intervening runtime component performs routing.

[0340] An eABI-aware runtime 180 may be implemented as a relay, bridge, shim, trampoline, thunk, dispatcher, routing component, or combination thereof and may interoperate with a traditional runtime 338 while providing eABI-mediated operations.

[0341] A “runtime component” is software, processor instructions 120, executable-side runtime functionality, a runtime module, loaded executable 364, common memory routing code, firmware, hardware, or combination thereof that performs or causes at least one eABI-aware runtime operation. Runtime components may be separate from, incorporated into, or distributed among loaded executables and execution environments.

[0342] In certain embodiments, the one or more runtime components of an eABI-aware runtime may include calling-side runtime functionality associated with a calling loaded executable, routing functionality implemented outside or between source and destination execution environments, and called-side runtime functionality associated with a called loaded executable.

[0343] The calling-side runtime functionality may dispatch an outbound note or other eABI-defined transfer representation from a source execution environment; the routing functionality may route the transfer representation while the transfer representation is in transit; and the called-side runtime functionality may deliver an inbound transfer representation within a destination execution environment. The runtime components may be separate from the loaded executables, incorporated into or associated with the loaded executables, distributed among different execution environments, implemented by a processor-supported transfer mechanism, or implemented by a combination thereof.

[0344] A “routing component” is software, processor instructions 120, firmware, hardware, runtime, loader, operating system, hypervisor, kernel, executable-side, processor-supported, or combined functionality that determines or applies a route for a note 212, control transfer 214, data exchange 312, or return pathway. It may supply routing information, forward a note, enable controlled entry or exit, or establish a direct note-transfer path.

[0345] An eABI-aware runtime 180 may be initialized before, during, or after one or more loaded executables 364 by an enclave-aware loader 146, entry / exit bootstrap module 288, operating system 148, loaded executable, or combination thereof.

[0346] An eABI-aware runtime 180 or entry / exit bootstrap module 288 may be implemented as an eABI-common executable 208 in common memory 166, as an enclave-aware executable 126 in a trusted execution environment 326, as functionality compiled into participating eABI-aware executables 112, or as a combination thereof.

[0347] An “enclave CRT”340 refers to toolchain-introduced runtime support code, a protected C runtime portion, runtime library portion, shim, stub, dispatcher, trampoline, initialization component, or other support code associated with a loaded enclave-aware executable 268 or loaded eABI-aware executable 240 and configured to execute within an enclave 104 or trusted execution environment 326. In certain embodiments, an enclave CRT may be generated, linked, inserted, adapted from a C runtime, derived from a language runtime, or otherwise associated with a protected section 156 of an enclave-aware executable file 264 by an enclave-aware compiler 122, linker, loader-preparation tool, runtime library, enclave-aware loader 146, or other toolchain component. The enclave CRT is not application code manually written by a programmer to implement an enclave-specific interface, explicit trusted execution environment lifecycle call, manually written trusted execution environment transition wrapper, or explicit marshaling code. Rather, the enclave CRT may provide protected runtime support that allows code executing within the enclave or trusted execution environment to interoperate according to the eABI 114.

[0348] In certain embodiments, the enclave CRT 340 may perform or assist with program initialization, library initialization, protected runtime state setup, stack setup, heap setup, thread-local storage setup, exception handling, cleanup, entry point handling, dispatch table setup, symbol table setup, key table setup, trust table setup, external symbol dependency map setup, published symbol map setup, or combinations thereof. The enclave CRT may also perform or assist with note 212 formation, note ingestion, dispatch, delivery, return processing, selected data security mode 374 application, encryption, decryption, authentication, integrity checking, replay checking, validation, controlled-entry enforcement, argument recovery, return-value handling, restricted-operation request handling, or combinations thereof. In runtime-mediated transfer embodiments, the enclave CRT may stream, copy, encrypt into, decrypt from, or otherwise convey all or a portion of an outbound note 290, inbound note 292, protected payload 276, return note, or return payload through a transit buffer 308 while cooperating with an eABI-aware runtime 180, routing component, entry / exit bootstrap module 288, unprotected runtime portion, loaded eABI-common executable 250, or combinations thereof. In direct note-transfer embodiments, the enclave CRT may perform source-side or destination-side protected processing without requiring a protected payload or return payload to be placed in a transit buffer in common memory 166.

[0349] In certain embodiments, a conventional C runtime, standard library runtime support, or other language runtime may be split, partitioned, adapted, supplemented, or replaced so that a protected runtime portion executing within an enclave 104 or trusted execution environment 326 forms at least part of the enclave CRT 340, while an unprotected runtime portion executes in common memory 166 to perform services unavailable, restricted, or intentionally external to the enclave or trusted execution environment. The enclave CRT may cooperate with the unprotected runtime portion to provide conventional runtime behavior to generic source code 118 or enclave-aware source code 142 while preserving eABI-governed interoperability across execution environment boundaries. An enclave CRT need not include an entire traditional runtime 338, entire standard library 282, or entire eABI-aware runtime 180 within the enclave or trusted execution environment.

[0350] Runtime components may support a call transition or data exchange by preparing arguments; maintaining a per-call or per-thread execution context 420; forming, dispatching, routing, receiving, or delivering a note 212; processing return information; and restoring or resuming execution state.

[0351] An eABI-aware runtime may facilitate an eABI operation by applying eABI metadata associated with executable files, runtime information derived during loading or execution, symbol resolution information, note routing information, selected data security mode information, trust information, execution environment information, or combinations thereof. The runtime may permit, coordinate, reject, defer, or request reformulation of the operation according to those inputs.

[0352] A “runtime registration record” (FIG. 53) is runtime information created, updated, or made available when a loaded enclave-aware executable 268 is registered for eABI-mediated interoperability. The record may identify an executable, protected section, or publisher identity; a certificate validation result 378 or trust determination; permitted published symbols 194, external symbol dependencies 184, boundary classes, data security modes 130, or defined entry points 262; and combinations thereof.

[0353] Registering a loaded enclave-aware executable 268 for eABI-mediated interoperability may include creating, updating, or making available a runtime registration record that associates the loaded executable with identity, trust, symbol, dependency, boundary-class, entry point, data security mode, or operation-specific permission information.

[0354] A runtime registration record may be centralized or distributed, persistent or transient, and represented by table entries, maps, descriptors, handles, capabilities, tokens, metadata fields, cached values, policy results, or combinations thereof. The enclave-aware loader 146, eABI-aware runtime 180, operating system 148, hypervisor 226, firmware, trusted execution environment 326, loaded executable 364, or policy service may maintain or expose all or part of the record.

[0355] Before permitting an eABI-mediated operation involving a registered loaded executable, the eABI-aware runtime 180 or another enforcing component may access the runtime registration record and apply the corresponding operation-specific permission to permit, restrict, rate-limit, defer, or deny the operation.

[0356] In certain embodiments, registration for eABI-mediated interoperability establishes operation-specific authorization state for a loaded enclave-aware executable 268. Registration may be completed when a runtime registration record has been created or updated to associate a trust determination and an identity of the loaded enclave-aware executable or a protected section 156 with at least one operation-specific permission and the runtime registration record has been made available for enforcement. Merely identifying a file name, binary identity, storage location, enclave handle, or executable location without establishing an operation-specific permission need not complete registration for eABI-mediated interoperability. After registration, an eABI-aware runtime 180 or loaded executable 364 may permit an eABI operation only in accordance with the corresponding operation-specific permission in the runtime registration record.

[0357] Before resolving an external symbol dependency 184 of a first loaded executable to a published symbol 194 of a second loaded executable, the eABI-aware runtime 180 or first loaded executable may evaluate the second executable's runtime registration record and provenance information 380. Resolution may require a certificate validation result 378 and publisher identity accepted by a trust policy 386, an executable version satisfying a dependency rule, and an operation-specific permission authorizing the symbol or dependency. If a condition fails, resolution may be denied, deferred, or directed to another compatible and authorized publisher.

[0358] A runtime registration record may expressly associate a published symbol 194 with one or more permitted external symbol dependencies 184 and an operation-specific permission for resolution. The eABI-aware runtime 180 applies that permission, together with applicable trust, publisher, provenance, version, and dependency-policy conditions, before completing the resolution.

[0359] In the architecture described herein, an “enclave-aware runtime” need not be provided as a distinct category of runtime executing within each enclave 104. Execution within an enclave may be performed by one or more loaded enclave-aware executables 268 under control of an enclave-aware processor 124, while interoperability between untrusted and trusted execution environments 326 may be mediated, facilitated, or coordinated by the eABI-aware runtime 180. Accordingly, runtime functionality associated with cross-boundary communication may be centralized within the eABI-aware runtime, distributed among loaded executables 364, implemented within one or more trusted execution environments, implemented within the kernel, or combinations thereof.

[0360] In certain embodiments, separating eABI-aware runtime 180 functionality from one or more enclaves 104 may reduce the trusted computing base within the enclaves by avoiding inclusion of a full runtime environment inside enclave memory. For example, the eABI-aware runtime may execute at least partly in common memory 166 and may coordinate control transfer, data exchange, note 212 routing, note dispatch, return processing, data security mode 130 selection, policy evaluation, or combinations thereof across enclave boundaries.

[0361] Unless otherwise specified, “runtime,”“C runtime,” and “CRT” may refer to a traditional runtime 338 or an eABI-aware runtime 180.

[0362] An “entry / exit bootstrap module”288 (FIGS. 31 and 37) is executable logic that may be loaded or initialized by an enclave-aware loader 146 to initiate or terminate a thread of execution 224, invoke a defined entry point 262, initialize or tear down an eABI-aware runtime 180, and support controlled entry to or exit from loaded executables or trusted execution environments. The module may execute in common memory 166, a trusted execution environment 326, a kernel-resident trusted execution environment 416, or as part of a loader, runtime, or other loaded executable 364.

[0363] In certain embodiments, an initial outbound note 290 may include a main note 316 formed by, or formed in response to, the entry / exit bootstrap module 288 after initialization of the eABI-aware runtime 180, one or more loaded executables 364, or combinations thereof. The initial outbound note may correspond to a startup control transfer, initialization routine, entry point 262, main function, initial external symbol dependency 184, or combinations thereof.

[0364] In some embodiments, the enclave-aware loader 146 loads an entry / exit bootstrap module 288 within the common virtual address space 220 and provides entry point 262 information for a loaded eABI-aware main executable to the entry / exit bootstrap module. The entry / exit bootstrap module may initiate a thread of execution and may cause the thread of execution to enter the loaded eABI-aware main executable at an entry point identified by the entry point information.Data Security Mode

[0365] A “data security mode”130 (FIGS. 39 and 41) is an eABI-defined set of rules, metadata, processor instructions, cryptographic or validation operations, and policy requirements governing how a control transfer, data exchange, note 212, routable envelope 272, protected payload 276, symbol access, or return path is protected or processed. An enclave-aware compiler 122 may associate one or more candidate data security modes 372 with an executable, published symbol 194, external symbol dependency 184, note, or other eABI operation.

[0366] A default data security mode 130 may be established at loading, initialization, registration, or startup, and a selected data security mode 374 may be selected or changed during execution. Selection may account for candidate modes, allowed modes, trust policy, certificate validation result, provenance, system or user policy, symbol or dependency requirements, security objectives, performance objectives, and operating conditions. Different modes may trade confidentiality, integrity, identity assurance, cryptanalytic resistance, latency, throughput, and computational cost (FIGS. 39 and 44-45).

[0367] “Candidate data security modes”372 refer to one or more data security modes 130 that an eABI-aware executable 112, published symbol 194, external symbol dependency 184, note 212, protected payload 276, routable envelope 272, control transfer, data exchange, or combinations thereof is configured to support, accept, request, process, or use according to the eABI. In certain embodiments, an enclave-aware compiler 122 may generate, insert, encode, or associate candidate data security modes with an eABI-aware executable based on generic source code 118, enclave-aware source code 142, compiler options, pragmas, policy, or combinations thereof.

[0368] In certain embodiments, candidate data security modes 372 may be identified, generated, derived, stored, communicated, or updated by an enclave-aware compiler 122 (FIG. 48), enclave-aware loader 146, eABI-aware runtime 180, loaded eABI-aware executable 240, policy component, configuration information, executable metadata 244, eABI metadata 246, symbol metadata, or combinations thereof. In certain embodiments, compiler-generated candidate data security mode information may provide an initial set of candidate data security modes, while loader-generated, runtime-generated, policy-derived, or configuration-derived information may refine, restrict, update, supplement, or replace the candidate data security modes during loading, initialization, registration, execution, or combinations thereof (FIG. 42).

[0369] “Data security mode information” refers to information identifying, representing, constraining, requesting, selecting, applying, or prohibiting one or more data security modes 130. Data security mode information may include candidate data security modes 372, allowed data security modes 376, a selected data security mode 374, a requested data security mode, a default data security mode, a preferred data security mode, a required data security mode, a prohibited data security mode, a rejected data security mode, a fixed data security mode, or combinations thereof.

[0370] “Allowed data security modes”376 (FIG. 42) refer to one or more data security modes 130 permitted by a trust policy 386 or production mode 174 for an eABI-aware executable 112, control transfer, data exchange, note 212, published symbol 194, external symbol dependency 184, execution environment, trust status, certificate validation result 378, provenance information 380, or combinations thereof.

[0371] A “selected data security mode”374 (FIG. 42) refers to a data security mode 130 selected, determined, negotiated, accepted, maintained, communicated, or applied for a note 212, control transfer, data exchange, protected payload 276, routable envelope 272, symbol access, or combinations thereof according to the eABI 114. The selected data security mode may be determined based on a compatibility determination, intersection of data security modes, policy evaluation, trust determination, runtime negotiation, or combinations thereof involving candidate data security modes 372 supported by one or more participating loaded eABI-aware executables 240 and allowed data security modes 376 established by a policy.

[0372] A selected data security mode is maintained, applied, associated with, or in effect for a loaded executable 364, execution environment, usermode process 150, user session, note 212, control transfer 214, data exchange 312, published symbol 194, external symbol dependency 184, or combinations thereof. The selected data security mode may be determined according to a compatibility determination and may remain unchanged or may be modified during execution in response to policy evaluation, trust evaluation, runtime conditions, user requests, application requests, performance conditions, security requirements, or combinations thereof.

[0373] A “compatibility determination” refers to a determination of whether one or more candidate data security modes 372 supported by a first eABI-aware executable 112, one or more candidate data security modes supported by a second eABI-aware executable, and one or more allowed data security modes 376 established by a trust policy 386 include at least one data security mode 130 usable for a note 212, control transfer, data exchange, protected payload 276, routable envelope 272, or combinations thereof according to the eABI 114. In certain embodiments, the compatibility determination may consider candidate data security modes (FIG. 42), allowed data security modes, requested data security modes, preferred data security modes, rejected data security modes, required data security modes, prohibited data security modes, policy constraints, trust status, certificate validation results 378, provenance information 380, performance conditions, security requirements, or combinations thereof.

[0374] In certain embodiments, changing a selected data security mode 374 is not merely a selection of an encryption level for a network request or a sensitivity level assigned to a service request. Rather, the selected data security mode may be changed within eABI-mediated interoperability between loaded eABI-aware executables 240 in different execution environments based on compiler-generated eABI metadata 246, symbol metadata, processor instructions 120, candidate data security modes 372, allowed data security modes 376, published symbol 194 information, external symbol dependency 184 information, note 212 information, routable envelope 272 information, protected payload 276 information, or combinations thereof. In certain embodiments, the compatibility determination may be performed for a particular eABI-mediated control transfer 214, data exchange 312, note, published symbol, external symbol dependency, return note, return payload 352, or combinations thereof, rather than for a network endpoint, web service request, application programming interface request, or load-balancing decision.

[0375] In certain embodiments, a policy may establish one or more allowed data security modes 376 for eABI-mediated interoperability. The policy may apply to a system 100, operating system 148, user session, usermode process 150, executable file 190, loaded executable 364, execution environment, published symbol 194, external symbol dependency 184, note 212, protected payload 276, routable envelope 272, control transfer, data exchange, trust determination, certificate validation results 378, provenance information 380, or combinations thereof.

[0376] A selected data security mode 374 may be determined based on the intersection of candidate data security modes 372 (FIG. 42) supported by one or more participating loaded executables 364, allowed data security modes 376 established by the policy, and one or more policy considerations including confidentiality, integrity, identity assurance, performance, resistance to cryptographic attack, trust status, or combinations thereof.

[0377] In certain embodiments, the eABI-aware runtime 180 may determine, negotiate, or facilitate determination of a selected data security mode 374 and may communicate the selected data security mode to one or more loaded executables 364. The loaded executables may form, transmit, validate, encrypt, decrypt, route, dispatch, reject, reformulate, or process notes 212 according to the selected data security mode.

[0378] If a requested or selected data security mode 374 is unsupported by a participating loaded executable 364 or prohibited by policy, an eABI-aware runtime 180, enclave-aware loader 146, loaded executable, or policy component may reject, block, defer, downgrade, upgrade, renegotiate, request reformulation, or report an error. A permitted mode may change during execution in response to user or application requests, performance or load conditions, latency or throughput constraints, security requirements, trust determinations, or policy changes.

[0379] The eABI-aware runtime 180 may operate as a policy-aware broker or compatibility engine for data security modes 130 (FIGS. 39-40 and 42). It may receive or determine a request to select, change, negotiate, upgrade, downgrade, reject, or apply a selected data security mode 374 for a note 212, routable envelope 272, protected payload 276, symbol access, control transfer, or data exchange and may evaluate the request using executable, system, user, application, trust, certificate, provenance, security, and performance information.

[0380] Policy constraints for a data security mode 130 may be derived from eABI metadata 246, eABI trust evidence 382, a published symbol 194, an external symbol dependency 184, an execution environment, user session, usermode process 150, system or operating system policy, trust determination, certificate validation result 378, provenance information 380, system load, performance, user or application preference, security requirement, or combination thereof.

[0381] A loaded executable 364 may communicate a data security mode profile 384 to an eABI-aware runtime 180 or another loaded executable. The profile may identify candidate, supported, requested, preferred, rejected, minimum, required, prohibited, or allowed data security modes for a note 212, protected payload 276, published symbol 194, external symbol dependency 184, control transfer, or data exchange.

[0382] The eABI-aware runtime 180 or a participating enclave-aware executable may select or facilitate selection of a data security mode 374 by evaluating the participating executables' candidate modes, policy-allowed modes, requested or preferred modes, rejected or prohibited modes, trust and certificate results, provenance, performance conditions, and security requirements. The selected mode may be maintained per executable, symbol, dependency, note, transfer, exchange, session, process, execution environment, or combination thereof.

[0383] When a requested or selected data security mode is unsupported or violates policy, trust, certificate, provenance, or other constraints, the eABI-aware runtime 180, loaded executable 364, enclave-aware loader 146, or policy component may reject, block, defer, downgrade, upgrade, renegotiate, report an error, or request reformulation. A participating executable may reformulate the note, payload, envelope, control transfer, or data exchange using a permitted mode.

[0384] “Plaintext mode”132 (FIGS. 39 and 44) may allow a note 212, routable envelope 272, protected payload 276, argument, return value, or other data exchange 312 to be conveyed between loaded executables 364 according to the eABI 114 without encrypting at least a portion of the protected payload data. In certain embodiments, plaintext mode may provide lower computational overhead relative to encrypted modes while providing reduced confidentiality protection for data visible in common memory 166 or to privileged software. A variation of plaintext mode may include signing, hashing, authentication, integrity checking, or combinations thereof to detect alteration of a note or other conveyed data. When a claim, embodiment, selected policy, published symbol, external symbol dependency, kernel service, isolated kernel resource, or other eABI operation requires payload information to be unavailable, unobtainable, or not obtainable in unprotected form by a routing component, kernel code outside a destination trusted execution environment, or another unauthorized component, plaintext mode does not satisfy that requirement to the extent use of plaintext mode would expose the payload information in unprotected form. In such embodiments, plaintext mode may be unavailable, rejected, renegotiated, or limited to non-sensitive fields, routable-envelope fields, common payload information, or other information expressly authorized to be visible outside the trusted execution environment.

[0385] “Encryption mode” (FIGS. 39 and 44) 134 may include encrypting at least a portion of a note 212, protected payload 276, argument, return value, or other data exchange 312 conveyed through common memory 166 or another execution environment according to the eABI. Encryption mode may be used to reduce the ability of unauthorized software to interpret encrypted content and may be combined with authentication, integrity checking, replay protection, ordering information, freshness information, sequence information, or combinations thereof. Encryption mode may use enclave-compatible cryptographic keys 170, public key cryptography, shared keys, session keys, long-term keys, Diffie-Hellman key exchange, block ciphers, stream ciphers, authenticated encryption, post-quantum cryptography, key pairs, or combinations thereof.

[0386] “Encryption-with-validation mode” refers to a data security mode 130 (FIG. 39) that combines one or more characteristics of encryption mode 134 and validation mode 136. In certain embodiments, encryption-with-validation mode may encrypt at least a portion of a protected payload 276 while also validating, authenticating, attesting, identifying, or otherwise verifying one or more participating loaded executables 364, execution environments, trusted execution environments 326, published symbols 194, external symbol dependencies 184, certificates 168, provenance information 380, or combinations thereof.

[0387] “Validation mode”136 (FIGS. 39 and 44) may include validating, authenticating, attesting, re-attesting, identifying, or otherwise verifying a loaded eABI-aware executable 240, enclave 104, trusted execution environment 326, published symbol 194, external symbol dependency 184, note 212, protected payload 276, routable envelope 272, or combinations thereof before, during, or after a control transfer or data exchange according to the eABI 114. Validation mode may be used to provide identity assurance, detect substitution, reduce spoofing risk, reduce man-in-the-middle risk, validate provenance information 380, validate certificate validation results 378, or combinations thereof.

[0388] “Secure mode”137 (FIGS. 39 and 44) may include encrypting at least a portion of a note 212, protected payload 276 using one or more one-time keys, short-term keys, session keys, ephemeral keys, enclave-compatible cryptographic keys 170, or combinations thereof. Secure mode may reduce the ability of unauthorized software to interpret encrypted content while the note, protected payload, argument, return value, control transfer, data exchange, or combinations thereof is conveyed between enclaves 104, trusted execution environments 326, execution environments, or combinations thereof. In certain embodiments, secure mode may encrypt conveyed data without validating, authenticating, attesting, re-attesting, identifying, or otherwise verifying one or more parties, enclaves, trusted execution environments, loaded eABI-aware executables 240, published symbols 194, external symbol dependencies 184, or combinations thereof. Accordingly, secure mode may provide increased confidentiality relative to plaintext mode 132 while providing reduced identity assurance relative to validation mode 136 or max mode 138, and may be susceptible to substitution, spoofing, man-in-the-middle, enclave-in-the-middle, or other intermediary attacks when a communicating party or execution environment is not validated.

[0389] “Max mode”138 (FIGS. 39 and 44) may include applying encryption mode 134, validation mode 136, integrity checking, authentication, replay protection, freshness checking, per-note key generation, per-session key generation, re-attestation, provenance validation, certificate validation, or combinations thereof to a note 212, protected payload 276, routable envelope 272, control transfer, data exchange, or combinations thereof. In certain embodiments, max mode may use one-time or short-term enclave-compatible cryptographic keys 170 generated for an individual note, session, control transfer, data exchange, or combinations thereof. Max mode may provide increased confidentiality, integrity, identity assurance, or resistance to cryptographic attack relative to one or more other data security modes 130, while potentially increasing computational cost, latency, memory use, or combinations thereof.Symbols

[0390] A “published symbol”194 (FIGS. 12-13) refers to a function, variable 286, data object, service, entry point 262, callable interface, exported interface, isolated kernel code 418, kernel service interface 414, or other symbol made available by a loaded executable 364, kernel-resident enclave 402, kernel-resident trusted execution environment 416, or other execution environment for access according to the eABI 114. A published symbol may be identified by an enclave-aware compiler 122, linker, enclave-aware loader 146, eABI-aware runtime 180, or combinations thereof. Published symbol information may include a symbol name, symbol identifier, symbol hash, datatype, function signature, entry point, candidate data security modes 372, trust information, isolated kernel resource request information, or combinations thereof, and may be stored in eABI metadata 246, a symbol table 314, runtime information, kernel service interface, or combinations thereof.

[0391] In certain embodiments, when an enclave-aware compiler 122 identifies a published symbol 194 in generic source code 118 (FIGS. 8-9), the enclave-aware compiler may generate an eABI-aware executable file 238, enclave-aware executable file 264, or combinations thereof that include processor instructions 120, eABI metadata 246, symbol table 314 information, published symbol information, note ingestion semantics, note dispatch semantics, controlled entry point semantics, candidate data security modes 372, trust information, or combinations thereof associated with the published symbol. After at least a portion of the executable file 190 is loaded to form a loaded eABI-aware executable 240, loaded enclave-aware executable 268, kernel-resident enclave 402, kernel-resident trusted execution environment 416, or combinations thereof, the generated information may be used to publish, advertise, validate, route to, dispatch to, or otherwise make available the published symbol according to the eABI.

[0392] In certain embodiments, a loaded eABI-aware executable 240 may make published symbol information available to another loaded eABI-aware executable, an eABI-aware runtime 180, enclave-aware loader 146, symbol resolution service, trusted execution environment 326, or combinations thereof (FIG. 37). The published symbol information may be distributed peer-to-peer, through a runtime-maintained registry, through loader-facilitated initialization, through trusted execution environment communication, through a transit buffer 308, or combinations thereof.

[0393] An “external symbol dependency”184 (FIGS. 12-13) is a dependency of a loaded executable 364 on a function, variable 286, data object, service, entry point 262, callable interface, or other published symbol 194 defined outside that executable. Dependency information may include a name, identifier, hash, datatype, function signature, calling convention, version, candidate data security modes 372, trust requirement, or combination thereof.

[0394] When an enclave-aware compiler 122 identifies an external symbol dependency 184, it may generate processor instructions 120, eABI metadata 246, symbol table information, note formation semantics, candidate data security modes 372, and other information used after loading to resolve the dependency and form, dispatch, route, deliver, or process a note 212.

[0395] A “symbol table”314 may be included in an executable file, metadata, runtime, or other structure identifying published symbols 194, external symbol dependencies 184, names, identifiers, addresses or offsets, sections 152, datatypes, function signatures, relocations, or combinations thereof. A compiler, linker, loader, runtime, or loaded executable may use the symbol table for linking, loading, resolution, note formation, dispatch, or controlled entry.

[0396] In some embodiments, eABI metadata 246 of an eABI-aware executable file 238 includes one or more symbol table entries, dependency records, published symbol records, relocation records, or other binary-level records used by an enclave-aware loader or by a symbol resolution interface defined by the eABI. A symbol table entry may identify an external symbol dependency of a loaded eABI-aware main executable, and another symbol table entry may identify a published symbol of a loaded eABI-aware library executable corresponding to the external symbol dependency. Symbol table entries may be transmitted to other eABI-aware executables or the eABI-aware runtime to facilitate symbol resolution to the TEEs or enclaves containing the published symbol.

[0397] A published symbol 194 (FIGS. 12-13) may be semantically matched to an external symbol dependency 184 using one or more compatibility criteria, including a name, identifier, hash, function signature, datatype, return or parameter datatype, calling convention, version, security or mode requirement, and trust requirement. The match may require identity, equivalence, compatibility, authorization, or collective satisfaction of specified criteria under the eABI 114.

[0398] In certain embodiments, a loaded eABI-aware executable 240, enclave-aware loader 146, eABI-aware runtime 180, trusted execution environment 326, kernel-resident enclave 402, kernel-resident trusted execution environment 416, kernel service interface 414, isolated kernel code 418, or combinations thereof may compare an external symbol dependency 184 to published symbol information and determine symbol resolution information, note routing information, or both. The note routing information may identify a target loaded executable 364, target execution environment, published symbol, entry point 262, selected data security mode 374 constraint, isolated kernel resource request information, or combinations thereof for an outbound note 290. The target execution environment may include common memory 166, a trusted execution environment, kernel-resident enclave, kernel-resident trusted execution environment, isolated kernel code, or combinations thereof.

[0399] In a traditional execution environment, an external symbol dependency 184 may be resolved within common memory 166 according to a traditional ABI 342, and symbol resolution may result in direct control transfer or data access using an address associated with a published symbol 194. In an eABI-aware environment, an external symbol dependency may be resolved according to the eABI 114, and access to the corresponding published symbol may be mediated using note 212 formation, controlled entry point semantics, eABI-aware runtime 180 dispatch, direct note transmission, validation semantics, selected data security mode 374 processing, or combinations thereof. This allows eABI-aware executables 112 in different execution environments to interoperate while preserving trusted execution environment 326 isolation.Note

[0400] A “Note”212 (FIGS. 50-51) refers to a data structure, message, record, buffer, or other eABI-defined representation used to support control transfer, data exchange, symbol access, argument passing, return processing, restricted instruction requests, or combinations thereof between eABI-aware executables 112 according to the eABI 114.

[0401] A note may include a routable envelope 272, protected payload 276, argument payload 318, referenced-data payload 350, return payload 352, cryptographic support information, tamper resistance information, replay resistance information, or combinations thereof (FIG. 50).

[0402] In certain embodiments, notes, protected payloads 276, routable envelopes 272, transit buffers 308, and selected data security modes 374 may be used to support protected communication between loaded eABI-aware executables 240, loaded enclave-aware executables 268, loaded eABI-common executables 250, kernel-resident enclaves 402, kernel-resident trusted execution environments 416, or combinations thereof. The protected communication may include encryption, authentication, validation, integrity protection, replay resistance, policy evaluation, or combinations thereof according to the eABI 114.

[0403] A note may be formed by a loaded enclave-aware executable 268, loaded eABI-aware executable 240, loaded eABI-common executable 250, eABI-aware runtime 180, entry / exit bootstrap module 288, kernel code, or combinations thereof (FIGS. 32, 34-37, and 54).

[0404] A note need not be stored as eABI metadata 246 in an executable file 190 and may instead be formed during execution by processor instructions 120 generated by an enclave-aware compiler 122. Generic source code 118 (FIGS. 8-9) may include a function call, external symbol dependency 184, system call 232, restricted instruction 204 operation, or other source code construct from which the compiler generates note formation semantics 370 (FIG. 35), processor instructions, eABI metadata, or combinations thereof for forming or processing the note in a loaded eABI-aware executable 240 according to the eABI 114.

[0405] A “processor-supported direct note-transfer mechanism” refers to processor hardware, microcode, firmware, a memory-management mechanism, a trusted execution environment transfer facility, an interconnect, or combination thereof configured to implement a direct note-transfer mode.

[0406] A note may be conveyed by runtime-mediated transfer through common memory 166 or a transit buffer 308 (FIG. 32), or by a processor-supported direct note-transfer mode. In runtime-mediated transfer, source-side functionality dispatches the note across a source execution environment boundary, routing functionality consults the routable envelope 272 while the note is in transit, and destination-side functionality delivers the note within the destination execution environment (FIGS. 33-34). In direct note-transfer mode, a processor-supported mechanism transfers the note without requiring routing code in common memory to receive, copy, decrypt, or interpret the protected payload 276. Either mode may use applicable trust, permission, policy, cryptographic-support, and selected data security mode 374 information.

[0407] In kernel-resident trusted execution environment embodiments, a kernel note or return kernel note may be processed under a selected data security mode while also being subject to a separate confidentiality or non-exposure requirement associated with the kernel service interface, published kernel-service symbol, isolated kernel resource, trust policy, or invocation. When the kernel note contains system call parameters, sensitive buffers, cryptographic material, credentials, authentication tokens, policy requests, symbol information, referenced data, return information, or other request data required to remain unavailable in unprotected form outside the destination trusted execution environment, the selected data security mode is selected or enforced so that the protected payload or return payload is recoverable by authorized code in the destination trusted execution environment but is not obtainable in unprotected form by a routing component or by kernel code outside the destination trusted execution environment. The routable envelope may remain visible for routing, policy, logging, or delivery purposes, while the protected payload remains interpretable only by authorized code within the destination trusted execution environment.

[0408] “Dispatch” or “dispatching” (FIGS. 33-34) refers to a phase in which a calling executable, or executable-side runtime functionality associated with the calling executable, forms, prepares, places, streams, forwards, or otherwise transfers an outbound note 290 out of or across a boundary of a first execution environment. Dispatch may include determining a destination, obtaining symbol resolution information, forming a routable envelope 272, forming or protecting a payload, and initiating transfer toward a second execution environment.

[0409] “Routing” (FIGS. 33-34) refers to a phase occurring after dispatch and before delivery in which a routing component consults or applies routing information and forwards, relays, transfers, or causes transfer of a note 212, thread of execution 224, control transfer 214, data exchange 312, or combination thereof toward a destination execution environment. Routing need not include interpretation of a protected payload 276.

[0410] “Delivery” or “delivering” (FIGS. 33-34) refers to a phase occurring after an outbound note arrives at or is made available to a destination execution environment, in which a called executable, or executable-side runtime functionality associated with the called executable, ingests, validates, processes, or otherwise makes information from the note available to called functionality and, when applicable, transfers control through a defined entry point 262.

[0411] “Dispatch semantics,”“routing semantics,” and “delivery semantics” refer to eABI-defined rules, requirements, formats, eABI metadata 246, processor instructions 120, operations, or combinations thereof governing dispatch, routing, and delivery, respectively. “Note routing semantics” refers to routing semantics applied to a note 212.

[0412] A “note-transfer path” refers to a logical or physical pathway through which all or a portion of a note is conveyed between execution environments. A note-transfer path may include one or more transit buffers 308 (FIG. 32), memory mappings, processor-supported transfer facilities, trusted execution environment transitions, runtime components, routing components, interconnects, or combinations thereof.

[0413] A “direct note-transfer mode” refers to an eABI-defined routing or transfer mode in which a processor-supported direct note-transfer mechanism or other routing mechanism transfers a note 212 from a first execution environment toward a second execution environment without requiring a common memory routing component to receive or copy the protected payload 276 or to interpret protected payload information in unprotected form. Before direct transfer, an eABI-aware runtime 180, enclave-aware loader 146, processor 106, or other routing component may establish or supply destination information, routing information, permission information, trust information, cryptographic-support information, selected data security mode information, target execution environment information 266, return-routing information, or combinations thereof. After supplying such information, the supplying component need not receive, copy, route, dispatch, decrypt, or interpret the protected payload or a corresponding return payload. The direct note-transfer mode may apply to an outbound note, a return note, or both, and need not place the protected payload or return payload in a transit buffer 308 in common memory 166.

[0414] “Note formation semantics”370 (FIG. 50) refer to binary-level rules, formats, operations, eABI metadata 246, processor instructions 120, or combinations thereof that define, constrain, or guide creation, composition, population, protection, routing, dispatch, validation, or processing of a note according to the eABI 114. Note formation semantics may correspond to an external call, control transfer 214, data exchange 312, external symbol dependency 184, published symbol 194, return path, restricted instruction 204 request, system call 232, kernel resource request, or combinations thereof. In certain embodiments, a loaded executable 364 may form a note according to note formation semantics generated by an enclave-aware compiler 122.

[0415] “Data transfer semantics” refer to eABI-defined rules, formats, representations, operations, or requirements for transferring arguments, referenced data, return values, status information, buffers, or combinations thereof between loaded executables 364 across an execution environment boundary. Data transfer semantics may define data layout (FIG. 50), argument representation, return value representation, buffer representation, copying operations, transit buffer 308 usage, calling convention information, or combinations thereof.

[0416] In certain embodiments, data transfer semantics may define note payload size information, note payload offset information, alignment requirements, parameter-slot locations, in-note stack offsets, in-note heap offsets, payload descriptors, copied-data descriptors, referenced-data descriptors, or combinations thereof.

[0417] “Data security mode semantics” refer to eABI-defined rules, requirements, operations, eABI metadata 246, processor instructions 120, or combinations thereof governing how a note, protected payload 276, routable envelope 272, data exchange, control transfer, return value, return status, or combinations thereof is protected or processed under a selected data security mode 374.

[0418] “Cryptographic support information” includes fields (FIG. 50), values, identifiers, eABI metadata 246, or structures used for confidentiality, integrity, identity assurance, freshness, replay resistance, validation, encryption, decryption, or authentication of a note or return pathway. Examples include a nonce, integrity or authentication value, key or algorithm identifier, freshness or replay value, protocol version, note version, or combination thereof.

[0419] In certain embodiments, cryptographic support information may include a caller identifier, target identifier, source identifier, destination identifier, caller hash, target hash, source hash, destination hash, note identifier, transit buffer identifier, boundary class identifier, execution environment identifier, or combinations thereof.

[0420] “Controlled entry point semantics” refer to eABI-defined rules, requirements, eABI metadata 246, processor instructions 120, or combinations thereof that direct or restrict a control transfer to one or more defined entry points 262 corresponding to a published symbol 194. In certain embodiments, when an external symbol dependency 184 in a first loaded eABI-aware executable 240 is resolved to a published symbol in a second loaded eABI-aware executable, the eABI may require the control transfer to occur through an entry point, gateway, trampoline, stub, dispatch target, or other defined interface corresponding to the published symbol, thereby reducing arbitrary control transfers into the second loaded executable 364.

[0421] A “controlled entry point” refers to a defined entry point 262 governed by controlled entry point semantics. A controlled entry point may be identified by eABI metadata 246, a published symbol 194, a symbol table 314, a dispatch table, a kernel service interface 414, processor-enforced entry information, or combinations thereof.

[0422] In certain embodiments, during delivery of an inbound note, the called loaded executable validates that a requested control transfer target is a defined entry point identified by eABI metadata for the published symbol. The called loaded executable rejects, traps, or otherwise prevents a requested control transfer to any address within the called loaded executable that is not designated as the defined entry point. Accordingly, the inbound note may be prevented from causing control transfer to an arbitrary address within the called loaded executable. A PHOSITA would recognize that controlled entry points increase the security of eABI-aware executables because controlled entry points prevent jumps or calls to arbitrary addresses in executables.

[0423] “Restricted instruction call semantics” (FIGS. 35 and 38) refer to eABI-defined rules, requirements, formats, call pathways, return pathways, validation operations, data transfer operations, or combinations thereof used when a loaded eABI-aware executable 240 operating in a trusted execution environment 326 or enclave 104 requests or causes a loaded eABI-common executable 250 in common memory 166 to execute a restricted instruction 204. Restricted instruction call semantics may define note formation, symbol resolution, argument transfer, return value transfer, return status transfer, data security mode processing, validation, dispatch, direct transmission, transit buffer 308 usage, or combinations thereof.

[0424] “Validation semantics” (FIG. 53) are eABI-defined rules or criteria for validating identity, eABI trust evidence 382, provenance information 380, measurement, publisher identity, certificate validation result, attestation evidence, cryptographic credentials, execution state, or combinations thereof before permitting dispatch, routing, delivery, return processing, symbol access, control transfer, or data exchange. Validation may include local or remote attestation, measurement, certificate chain, key, trusted root, publisher, or trust determination checks.

[0425] “Return semantics” (FIGS. 12, 32, 36, and 50-51) refer to eABI-defined rules, requirements, formats, operations, or pathways for returning control, data, a return value, return status, return note, system state, or combinations thereof from a called loaded executable 364 to a calling loaded executable. Return semantics may define a return note format, return value representation, return status representation, return payload 352, return routing information, transit buffer 308 usage, validation requirement, encryption requirement, or combinations thereof.

[0426] “Boundary class” refers to a category of control transfer or data exchange between execution environments according to the eABI 114. Boundary classes may include trusted execution environment-to-common memory transfers, common memory-to-trusted execution environment transfers, trusted execution environment-to-trusted execution environment transfers, kernel-to-usermode transfers, usermode-to-kernel transfers, or combinations thereof. The eABI may define different note formats, dispatch semantics, return semantics, data transfer semantics, validation semantics, data security mode semantics, or combinations thereof for different boundary classes.

[0427] Common memory 166 may include a “transit buffer”308 (FIGS. 32 and 36) used to store, copy, stream, transfer, encrypt into, decrypt from, or otherwise convey all or a portion of a note between loaded eABI-aware executables240 according to the eABI 114. A transit buffer may hold an outbound note 290, inbound note 292, routable envelope 272, protected payload 276, encrypted payload, note identifier, transit buffer identifier, common payload, or combinations thereof. A transit buffer may be pre-allocated, dynamically allocated, single use, reusable, selected based on note size or selected data security mode 374, or combinations thereof.

[0428] A note may include a main note 316, outbound note 290, inbound note 292, encrypted note 302, plaintext note, syscall note 306, return note, or combinations thereof.

[0429] A “main note”316 may initiate execution of a workload 252, main function, program entry point 262, or combinations thereof after initialization of an eABI-aware runtime 180 or one or more loaded executables 364. In certain embodiments, a main note may be composed by the entry / exit bootstrap module 288.

[0430] An “outbound note”290 may be formed by a first loaded eABI-aware executable 240 and routed, dispatched, directly transmitted, or otherwise conveyed toward a second loaded eABI-aware executable according to the eABI.

[0431] An “inbound note”292 may be received, transformed, copied, decrypted, authenticated, validated, re-encoded, or otherwise processed by the second loaded eABI-aware executable 240 according to the eABI.

[0432] An “encrypted note”302 refers to a note 212, outbound note 290, inbound note 292, return note, syscall note 306, kernel note 410, or portion thereof in which at least a portion of a protected payload 276 is encrypted according to a selected data security mode 374. The encrypted note may include, or be associated with, a routable envelope 272 usable by a routing component to route, dispatch, transmit, deliver, or return the encrypted note while the encrypted portion of the protected payload remains unavailable in unprotected form to the routing component. The encrypted portion of the protected payload may include symbol information, argument payload information, referenced-data payload information, return payload information, cryptographic support information, validation information, or combinations thereof, and may further be encoded, authenticated, integrity-protected, replay-protected, freshness-protected, validated, or otherwise protected according to the eABI 114. In certain runtime-mediated transfer embodiments, all or a portion of the encrypted note may be streamed, copied, encrypted into, decrypted from, or otherwise conveyed through a transit buffer 308, and a destination trusted execution environment 326 or enclave 104 may perform streaming decryption, authentication, integrity checking, replay checking, validation, or combinations thereof during note ingestion. In certain direct note-transfer embodiments, the encrypted note may be transferred without placing the encrypted portion of the protected payload in a transit buffer in common memory 166.

[0433] A “plaintext note” may include a protected payload 276, or portion thereof, that is conveyed without encryption according to plaintext mode 132, although the plaintext note may be signed, hashed, authenticated, integrity checked, validated, or otherwise processed when permitted by the selected data security mode 374.

[0434] A “decrypted note”310 refers to a note 212, protected payload 276, or portion thereof after encrypted, encoded, authenticated, integrity-protected, or otherwise protected note information has been decrypted, decoded, authenticated, validated, or otherwise made available in an unprotected or interpretable form within an authorized execution environment. In certain embodiments, a decrypted note is produced by streaming an encrypted note 302, protected payload, or portion thereof from a transit buffer 308 into a trusted execution environment 326 or enclave 104 and performing streaming decryption, authentication, integrity checking, replay checking, validation, or combinations thereof during note ingestion. A decrypted note need not be made available in common memory 166 or to a routing component, and may exist only transiently within the destination trusted execution environment for delivery, symbol identification, argument recovery, return processing, or other eABI-governed processing.

[0435] A “syscall note”306 (FIGS. 37-38) may correspond to a restricted instruction 204 request, system call 232 request, operating system interface request, isolated kernel resource request, standard library 282 service request, or other restricted operation request according to the eABI 114. The syscall note may be routed to a loaded eABI-common executable 250 in common memory 166, kernel service interface 414, isolated kernel code 418, kernel-resident enclave 402, kernel-resident trusted execution environment 416, operating system 148, hypervisor 226, or combinations thereof. In certain embodiments, the syscall note may allow a loaded executable 364 operating in a trusted execution environment 326 to request performance of an operation that is unavailable, restricted, mediated, or otherwise controlled within the trusted execution environment.

[0436] A restricted operation corresponding to a restricted instruction 204 (FIG. 38) may be performed by a loaded eABI-common executable 250 in common memory 166 according to the eABI 114. In certain embodiments, an enclave-aware executable 126 or loaded enclave-aware executable 268 may request performance of the restricted operation through a note 212, control transfer 214, syscall note 306, eABI-aware runtime 180, eABI-common executable 208, or combinations thereof.

[0437] In certain embodiments, a loaded enclave-aware executable may request performance of a restricted operation by forming an outbound note according to the eABI (FIGS. 32 and 35-37). The eABI-aware runtime may route the outbound note to a loaded eABI-common executable in common memory. The loaded eABI-common executable may perform the restricted operation in common memory and may form a return note including result information, status information, error information, return values, or combinations thereof.

[0438] When generic source code 118 contains an operation that requires, invokes, or compiles into a restricted instruction 204, an enclave-aware compiler 122 may identify the corresponding source code or intermediate representation portion and translate it into an eABI-common executable file 248 for loading into common memory 166 as a loaded eABI-common executable 250. The compiler may generate eABI metadata 246, symbol information, processor instructions 120, note formation semantics, and restricted instruction call semantics that cause protected executable content to request the operation, transfer only authorized call data, permit the loaded eABI-common executable to perform the operation outside the trusted execution environment 326, and return result information according to return semantics (FIG. 35).

[0439] Runtime-mediated dispatch, routing, and delivery of a note may collectively include preparing and protecting the note in the source execution environment (FIGS. 33-34); selecting a data security mode 374 (FIG. 39), key, and transit buffer 308; dispatching the note across the source boundary; routing the note in transit by consulting the routable envelope 272; and delivering the note within the destination execution environment (FIG. 32). A thread of execution 224 may exit a source enclave 104, execute routing code in common memory 166, and enter a target enclave, loaded eABI-common executable 250, or other target execution environment through controlled transitions. Dispatch remains the source-side phase that transfers the note across the source boundary, routing remains the in-transit phase that consults the routable envelope, and delivery remains the destination-side phase that ingests and processes the note.

[0440] In certain embodiments, a note may be transferred according to a direct note-transfer mode. In the direct note-transfer mode, a first loaded eABI-aware executable 240 may transmit an outbound note 290, an encrypted representation of the outbound note, a protected payload 276, a routable envelope 272, or combinations thereof from a first execution environment toward a second execution environment without requiring transfer of the outbound note through a transit buffer 308 in common memory 166. The first execution environment and the second execution environment may comprise respective first and second trusted execution environments 326. In one such embodiment, the first loaded eABI-aware executable may transmit the outbound note directly to a second loaded eABI-aware executable to implement control transfer, data exchange, or both without the eABI-aware runtime 180 receiving, routing, or dispatching the outbound note. Before the direct transmission, the eABI-aware runtime may establish or supply runtime state, routing information, security mode information, permissions, trust information, destination information, or combinations thereof used by the loaded eABI-aware executables for the direct note-transfer mode without interpreting the protected payload.

[0441] In certain embodiments, the direct note-transfer mode applies bidirectionally to an outbound note and a corresponding return note transferred between first and second trusted execution environments. Before dispatch, an eABI-aware runtime may supply destination information, permission information, trust information, cryptographic support information, selected data security mode information, target execution environment information 266, return-routing information, or a combination thereof. After supplying the information, the eABI-aware runtime does not receive, copy, route, dispatch, decrypt, or otherwise interpret the outbound note, the return note, the protected payload, or the return payload. The processor transfers the outbound note toward the second trusted execution environment and transfers the return note toward the first trusted execution environment using routing information in the respective routable envelopes, without placing either the protected payload or the return payload in a transit buffer in common memory and without requiring processor instructions executing outside the first and second trusted execution environments to receive or copy either payload. An enclave-aware compiler may generate eABI metadata and processor instructions within each participating executable file to implement the bidirectional direct note-transfer mode.

[0442] “Routable envelope”272 (FIG. 50) refers to a portion of a note 212 that includes routing information usable to route, dispatch, transmit, deliver, or otherwise direct the note from a first loaded eABI-aware executable 240 toward a second loaded eABI-aware executable according to the eABI 114. A routable envelope may include a note version, eABI version, source identifier, target identifier, execution environment identifier, boundary class identifier, dispatch flag, note size, selected data security mode 374, transit buffer 308 identifier, runtime-routing field, or combinations thereof. In certain embodiments, the routable envelope may be accessible to an eABI-aware runtime 180, operating system 148, hypervisor 226, loaded eABI-common executable 250, or combinations thereof, while a protected payload 276 remains protected from interpretation by such components.

[0443] “Protected payload”276 (FIG. 50) refers to a portion of a note 212 that includes information, data, metadata 244, eABI metadata 246, values, descriptors, copied data, cryptographic support information, or combinations thereof used to perform control transfer, data exchange, argument passing, referenced-data transfer, return processing, symbol access, or combinations thereof across an execution environment boundary according to the eABI 114.

[0444] A protected payload may include an argument payload 318, referenced-data payload 350, return payload 352, validation information, symbol information, copied data, in-note stack 356 data, in-note heap 358 data, or combinations thereof. A protected payload may be encrypted, encoded, authenticated, integrity protected, validated, or otherwise protected so that an eABI-aware runtime 180 may route a note using a routable envelope 272 without allowing the eABI-aware runtime, operating system 148, hypervisor, or other executables not involved with the note to interpret the protected payload in unprotected form.

[0445] In certain embodiments, a note 212 may separate routing visibility from symbol visibility (FIG. 50). A routable envelope 272 may include information sufficient for an eABI-aware runtime 180 to route or dispatch the note toward a target execution environment, while symbol information identifying a published symbol 194, external symbol dependency 184, function, service, entry point 262, data object, or combinations thereof is maintained within the protected payload 276. Upon delivery to the target execution environment, an authorized component associated with the target execution environment may decrypt, authenticate, validate, or otherwise process the protected payload to determine the symbol or operation requested by the note. This separation may permit an untrusted, less-trusted, routing-only, or otherwise unauthorized component to deliver the note without determining, in unprotected form, which symbol or operation is being invoked within the target execution environment.

[0446] “Tamper resistance information” (FIG. 50) refers to information, fields, values, metadata 244, eABI trust evidence 382, cryptographic values, structural values, duplicated values, or combinations thereof configured to detect modification, substitution, redirection, or other alteration of a note 212, routable envelope 272, protected payload 276, selected data security mode 374, transit buffer 308 identifier, execution environment identifier, or combinations thereof. Tamper resistance information may include an integrity value, authentication tag, hash value, digest, checksum, envelope-validation information, payload-validation information, duplicated envelope information, duplicated routing information, or combinations thereof.

[0447] In certain embodiments, a target execution environment identifier may be stored in the routable envelope, and a corresponding copy may be stored in the protected payload for comparison after the protected payload is processed in the target execution environment. If the value does not match, an enclave-in-the-middle attack may be detected.

[0448] “Replay resistance value” refers to information, fields, values, metadata 244, eABI metadata, cryptographic values, freshness values, ordering values, session values, invocation values, or combinations thereof configured to detect, reject, limit, or prevent reuse of a note 212, routable envelope 272, protected payload 276, or combinations thereof. Replay resistance information may include a nonce, one-time-use value, freshness value, sequence value, invocation identifier, monotonic counter, timestamp, random value, session identifier, execution environment identifier, loaded executable 364 identifier, note identifier, return path identifier, or combinations thereof. In certain embodiments, replay resistance information may bind a note to a particular invocation, session, source execution environment, target execution environment, loaded executable, selected data security mode 374, or combinations thereof.

[0449] “Argument payload”318 refers to information, data, metadata 244, eABI metadata 246 values, constants, variable names, key-value pairs, descriptors, type information, storage location information, copying instructions, policy information, or combinations thereof included in a note 212 and used to represent one or more function call arguments 362 passed from a calling loaded executable 364 to a called loaded executable across an execution environment boundary according to the eABI 114. An argument payload may include direct argument information 348, pass-by-value data, constants, scalar values, aggregate values, pointer values, reference values, parameter-order information, calling convention information, datatype information, register-argument information, stack-argument information, descriptors referencing a referenced-data payload 350, descriptors referencing an in-note heap 358, or combinations thereof.

[0450] “Direct argument information”348 refers to argument payload information used to represent a function call argument 362 directly in a note 212 without copying additional referenced data. Direct argument information may include constant values, literal values, immediate values, scalar values, pass-by-value values, fixed-size aggregate values, register-argument values, stack-argument values, datatype information, size information, alignment information, parameter-order information, expression values, or combinations thereof.

[0451] “Referenced-data payload”350 refers to information, data, metadata 244, copied data, temporary data, descriptors, layouts, offsets, sizes, type information, storage location information, copying instructions, policy information, or combinations thereof included in a note 212 and used to represent, copy, describe, validate, restore, or return data referenced by an argument across an execution environment boundary according to the eABI 114. A referenced-data payload may include copied referenced data, shallow-copy data, deep-copy data, copied strings, copied arrays, copied buffers, copied structures, copied object graphs, buffer descriptors, bounds information, length information, alias information, ownership information, mutability information, copy-in descriptors, copy-out descriptors, copy-in / copy-out descriptors, return-copy descriptors, in-note heap 358 allocations, in-note stack 356 allocations, or combinations thereof.

[0452] In certain embodiments, an enclave-aware compiler evaluates generic source code and enclave-aware source code to determine how each argument in a function call will map to an argument payload (FIG. 50). A PHOSITA would appreciate that an enclave-aware compiler may significantly automate the employment of TEEs over SDK-based development (FIGS. 18 and 24A-C) and may reduce development effort for the ubiquitous employment of TEEs.

[0453] In certain embodiments, information in a protected payload corresponding to an invocation is limited to direct values of arguments of the invocation, referenced data expressly selected for transfer or copying according to a function signature, eABI metadata, a policy, or a combination thereof, descriptors identifying the selected referenced data, and return-related information. Data maintained in the source trusted execution environment that is neither represented by an argument of the invocation nor selected for transfer remains inaccessible to the called executable and, when the destination is a kernel-resident trusted execution environment, to kernel code outside the destination trusted execution environment.

[0454] In certain embodiments, when an in-note stack is used, the in-note stack may store stack-argument information, variadic-argument data, call frame data, or a combination thereof. An in-note heap may store variable-size copied data, referenced data, serialized data, or a combination thereof.

[0455] “Return payload”352 refers to information, data, metadata 244, values, descriptors, status information, or combinations thereof included in a note 212 or return note and used to return control, return values, modified referenced data, output buffer data, status codes, error information, exception information, or combinations thereof from a called loaded eABI-aware executable 240 to a calling loaded eABI-aware executable across an execution environment boundary according to the eABI. After a called loaded eABI-aware executable performs a control transfer or data exchange associated with an inbound note 292, the called loaded executable 364 may form a return note including the return payload and dispatch the return note toward the calling loaded executable according to return semantics.

[0456] Before dispatching an outbound note 290, a calling executable may save an execution context 420 associated with an invocation. The saved execution context may include register state, stack state, base-pointer state, stack-pointer state, instruction-pointer state, per-thread state, argument state, return state, note state, selected data security mode state, or a combination thereof. Runtime state, note state, or caller-private state may associate an invocation identifier, note identifier, return-path identifier, replay resistance value, saved calling context identifier, or a combination thereof with the saved execution context and may indicate whether the invocation is being dispatched, routed, delivered, processed by called functionality, or returned. In certain embodiments, at least a portion of the saved execution context may be caller-encrypted, authenticated, integrity protected, stored in caller-private memory, stored in a protected payload 276 (FIG. 50), stored in a private stack, represented by a protected descriptor, or combinations thereof so that a called executable, routing component, or other component cannot tamper with the saved execution context in unprotected form. Upon delivery of a validated return note, the calling executable correlates the return note with the saved execution context, applies a return value, return status, modified referenced data, output buffer data, error information, exception information, or other return information, and restores or resumes execution associated with the saved execution context.

[0457] The return payload 352 may use the same data security mode 130 as the initiating note or a different data security mode according to the eABI.

[0458] “Common payload” refers to data, metadata 244, arguments, identifiers, handles, descriptors, references, copied data, transformed data, sanitized data, plaintext data, unencrypted data, or combinations thereof included in, associated with, referenced by, or stored for use with a note 212 and usable by a loaded eABI-common executable 250 in common memory 166 to perform a requested operation according to the eABI 114. A common payload may be maintained in a form accessible to the loaded eABI-common executable rather than encrypted from the loaded eABI-common executable. In certain embodiments, a common payload may be associated with a restricted instruction 204 request and may provide information usable by the loaded eABI-common executable to perform a restricted operation without requiring direct access to private data maintained within a trusted execution environment 326.

[0459] In certain embodiments, a common payload associated with an outbound note for a restricted operation may include a symbol identifier, service identifier, operation identifier, restricted operation identifier, function identifier, argument information, handle, descriptor, copied argument value, sanitized data, or combinations thereof. The symbol identifier, service identifier, operation identifier, or restricted operation identifier may correspond to a published symbol of a loaded eABI-common executable and may be usable by the loaded eABI-common executable to identify processor instructions configured to perform the restricted operation in common memory without requiring direct access to private data maintained within a trusted execution environment.

[0460] “Call data” includes argument information, referenced data, direct values, copied or transformed data, sanitized data, handles, descriptors, identifiers, function signature information, return-related information, or combinations thereof associated with an invocation. “Selected call data” is call data selected under eABI metadata 246, data transfer semantics, function signature information, policy, or a combination thereof for release from a source execution environment or use by called functionality.

[0461] In one embodiment, a single enclave-aware executable file includes a protected section and an unprotected section corresponding to a restricted operation. Loading the protected section into a trusted execution environment forms at least part of a loaded enclave-aware executable that acts as a calling executable, and loading the unprotected section into common memory forms at least part of a loaded eABI-common executable that acts as a called executable. eABI metadata in the single enclave-aware executable file identifies the trusted execution environment as a target execution environment for the protected section, identifies common memory as a target execution environment for the unprotected section, identifies an external symbol dependency associated with the protected section, and identifies a published symbol and defined entry point associated with the unprotected section. The protected and common executable portions may therefore originate from the same executable file while operating as distinct loaded eABI-aware executables according to the eABI.

[0462] An “in-note argument region”354 (FIG. 50) refers to a portion of a note 212 configured to store or reference an argument payload 318, referenced-data payload 350, return payload 352, or combinations thereof. The in-note argument region may include register-argument slots, stack-argument slots, parameter descriptors, argument values, referenced-data descriptors, offsets into an in-note heap 358, return payload descriptors, or combinations thereof.

[0463] An “in-note stack”356 (FIG. 50) may store argument payload information using a stack-like representation.

[0464] An “in-note heap”358 (FIG. 50) may store variable-size, referenced, copied, serialized, or less-structured data associated with one or more function call arguments 362.

[0465] In certain embodiments, generic source code 118 (FIGS. 8-9) or enclave-aware source code 142 (FIG. 46) compiled by an enclave-aware compiler 122 may use function signature information, datatype information, argument-expression information, pointer or reference information, storage location information, mutability information, ownership information, eABI metadata 246, selected data security mode 374, policy, or combinations thereof to generate note formation semantics 370 or call data for a function call argument 362. The note formation semantics may cause the function call argument to be represented in a note 212 as direct argument information 348, copied referenced data, a descriptor, shallow copy, deep-copy, copy-in transfer, copy-out transfer, or combinations thereof.

[0466] In certain embodiments, a loaded executable 364 or eABI-aware runtime 180 may use the note formation semantics 370, eABI metadata 246, selected data security mode 374, policy, or combinations thereof to form, validate, dispatch, reformulate, or process the argument payload 318, referenced-data payload 350, return payload 352, call data, or combinations thereof according to the eABI 114.

[0467] “Note ingestion” may include locating or copying a note 212 or partial note from a transit buffer 308; decrypting, authenticating, validating, deduplicating, or interpreting note information; selecting a key; determining whether the note represents a new call, restricted operation, kernel request, or return; and transferring authorized data into the destination execution environment. The ingested note or derived information may be provided to an in-enclave dispatcher 344 or return-processing logic.

[0468] An “in-enclave dispatcher”344 is processor instructions, executable code, dispatch logic, symbol or resolution information, or note ingestion logic associated with a loaded eABI-aware executable 240 or trusted execution environment 326 and configured to process a note 212 according to the eABI 114. It may identify a published symbol 194, defined entry point 262, kernel service interface 414, data object, or return path and transfer control or data accordingly.

[0469] An enclave-aware compiler 122, linker, enclave-aware loader 146, eABI-aware runtime 180, or combination thereof may generate, insert, configure, associate, or make available the processor instructions, eABI metadata 246, symbol tables 314, resolution information, and note ingestion or dispatch information used by an in-enclave dispatcher 344.

[0470] Generic source code 118 (FIGS. 8-9) need not include source-level dispatcher, note ingestion, note dispatch, note routing, symbol table, routable envelope, protected payload, explicit marshaling, or trusted execution environment transition logic. The enclave-aware compiler 122, linker, enclave-aware loader 146, eABI-aware runtime 180, or loaded executables 364 may generate or provide the corresponding binary-level processor instructions, eABI metadata 246, symbol tables 314, note structures, dispatch information, routing information, delivery information, and transition behavior.Default Data Protection and Sharing

[0471] This section describes opposing default data-placement postures that an enclave-aware compiler 122 may apply to variables 286, data objects, and referenced data (FIGS. 43, 45, and 52). In protect-by-choice mode, data is placed in common memory 166 by default and is protected when a storage class assignment is made to the variable in the source code; in share-by-choice mode, data is protected by default and is made available outside the trusted execution environment 326 only when sharing is indicated in the source code.

[0472] A “variable”286 refers to a data object, referenced-data object, local variable, global variable, initialization value, storage region, relocation-associated data, or combinations thereof represented in source code 188, an executable 110, memory 108, a note 212, or combinations thereof. A variable may be placed in common memory 166, a protected section 156, an enclave 104, a trusted execution environment 326, a kernel-resident enclave 402, a kernel-resident trusted execution environment 416, a protected payload 276, or combinations thereof according to compiler-generated information, eABI metadata 246, policy, or combinations thereof. A variable may also be associated with a published symbol 194, external symbol dependency 184, argument payload 318, referenced-data payload 350, return payload 352, or combinations thereof.

[0473] “Share-by-choice mode” (FIG. 52) refers to a data-placement or data-sharing mode in which variables 286 associated with an eABI-aware executable 112 are treated as protected by default and are made available in common memory 166 based on enclave-aware compiler 122 argument-implied sharing 360 in source code 188 (FIGS. 8-9), enclave-aware source code 142 (FIG. 46), an enclave-aware storage class 270 (FIG. 47), function signature, published symbol 194 relationship, argument relationship, or combinations thereof. In share-by-choice mode, an enclave-aware compiler may treat a variable as protected by default by assigning the variable to a protected section 156 or otherwise designating the variable for placement in an enclave 104, trusted execution environment 326, kernel-resident enclave 402, kernel-resident trusted execution environment 416, or combinations thereof. The variable may instead be shared or designated for common memory placement based on an enclave-aware compiler argument-implied sharing from generic source code 118, denoting an enclave-aware storage class in enclave-aware source code, pragma, compiler option, policy, published symbol relationship, argument relationship, or combinations thereof according to the eABI 114.

[0474] For example, enclave-aware source code 142 (FIG. 46) processed in share-by-choice mode may declare an unmarked variable as protected by default and a variable having a compiler-recognized public specifier as common memory data:char a_secret_value [] = “xyzzy”;public int not a secret = 0;

[0475] In the preceding example, the enclave-aware compiler 122 may place a_secret_value in a trusted execution environment 326 and not_a_secret in common memory 166. Variables in the same source unit may therefore receive different placement based on the selected default rule, source-level guidance, policy, or a combination thereof.

[0476] “Protect-by-choice mode” (FIG. 52) refers to a data-placement or data-sharing mode in which variables 286 associated with an eABI-aware executable 112 are treated as unprotected by default and are placed in common memory 166 based on source code 188, an enclave-aware storage class 270, compiler option, policy, published symbol 194 relationship, argument relationship, or combinations thereof. In protect-by-choice mode, an enclave-aware compiler 122 may treat a variable as common memory data by default. The variable may be assigned to common memory unless source code, an enclave-aware storage class, compiler option, or combinations thereof indicate that the variable is to receive protected section 156 placement, enclave 104 placement, trusted execution environment 326 placement, kernel-resident enclave 402 placement, kernel-resident trusted execution environment 416 placement, note 212-mediated protection, or combinations thereof according to the eABI 114.

[0477] For example, enclave-aware source code 142 processed in protect-by-choice mode may leave an unmarked variable in common memory by default and mark another variable for protected placement:int not_a_secret = 0;private char a_secret_value [] = “xyzzy”;

[0478] In the preceding example, the enclave-aware compiler 122 may place not_a_secret in common memory 166 and a_secret_value in a trusted execution environment 326. Variables in the same source unit may therefore receive different placement based on the selected default rule, source-level guidance, policy, or a combination thereof.

[0479] In certain embodiments, share-by-choice mode, protect-by-choice mode, or combinations thereof may be selected, configured, or constrained by an enclave command line parameter 140, compiler option, pragma, build system setting, source-level directive, source code annotation, project configuration, or combinations thereof. The selected mode may apply at a source file, translation unit, executable file 190, loaded executable 364, variable 286, symbol, note 212, function call, argument, execution environment, or policy level.

[0480] An enclave-aware source code annotation, storage class-like specifier (FIG. 46), directive, function or dependency annotation, compiler option, or policy may specify minimum, maximum, required, preferred, or prohibited data security modes 130 for a call, argument, referenced data, symbol, control transfer, or data exchange. The enclave-aware compiler 122 may generate corresponding eABI metadata 246, processor instructions 120, note formation information, candidate data security modes 372, and policy information for use after loading.

[0481] “Argument-implied sharing”360 refers to compiler behavior in which an argument relationship in generic source code 118 (FIGS. 8-9) or enclave-aware source code 142 (FIG. 46) indicates that data corresponding to a function call argument 362 is authorized to be conveyed to a called function, loaded eABI-aware executable 240, loaded enclave-aware executable 268, kernel-resident enclave 402, kernel-resident trusted execution environment 416, or other trusted execution environment 326 implementing a published symbol 194 without requiring the data to be stored in common memory 166 in unprotected form. An enclave-aware compiler 122 may infer, from the argument relationship, symbol relationship, call relationship, external symbol dependency 184, published symbol, function signature, policy, or combinations thereof, that the corresponding data may be represented in a note 212 as an argument payload 318, referenced-data payload 350, descriptor, copy-in transfer, copy-out transfer, copy-in / copy-out transfer, or combinations thereof.

[0482] For example, source code may pass protected data as an argument to a function associated with a published symbol:private char a secret [] = “xyzzy”;int main ( ) { process value ( a_secret );}

[0483] In the preceding example, the argument relationship may authorize data corresponding to a_secret to be represented in a protected payload 276 for the called function or execution environment without maintaining the data in common memory 166 in unprotected form. The enclave-aware compiler 122 may generate note formation semantics 370, processor instructions 120, or eABI metadata 246 to convey a copy, reference, descriptor, or other permitted representation.Governed Launch, Trust Policy, and PKI

[0484] “Governed launch authorization” (FIG. 53) refers to an authorization, approval, permission, or eligibility determination indicating whether an enclave-aware loader 146 may load a protected section 156 into a trusted execution environment 326, initialize the trusted execution environment, form a loaded enclave-aware executable 268, register a loaded enclave-aware executable for eABI-mediated interoperability, or combinations thereof under a trust policy 386, production mode 174, certificate-based public key infrastructure 172, certificate validation result 378, provenance information 380, or combinations thereof.

[0485] A “governed operation” refers to a loading, initialization, registration, symbol-resolution, control transfer, data exchange, note processing, data security mode evaluation, execution, or other operation whose performance is permitted, restricted, denied, deferred, or conditioned based on a trust policy 386, trust determination, operation-specific permission, or combination thereof. Governed launch authorization may authorize one or more governed operations associated with loading, initialization, or registration.

[0486] “Trust policy”386 refers to one or more rules, requirements, constraints, or configuration values used by an enclave-aware loader 146, eABI-aware runtime 180, operating system 148, hypervisor 226, or combinations thereof to determine whether an enclave-aware executable file 264, certificate 168, certificate chain 388, protected section 156, loaded enclave-aware executable 268, or other eABI-aware executable 112 is trusted for loading, initialization, control transfer, or data exchange between loaded eABI-aware executables 240 according to the eABI 114.

[0487] The trust policy 386 may include a trusted root requirement, publisher allowlist or denylist, certificate usage requirement, executable type requirement, protected section requirement, dependency rule, organization policy, user policy, administrator policy, enterprise policy, data security mode 130 requirement, provenance requirement, certificate validation requirement, production mode requirement, eABI participation requirement, or combinations thereof.

[0488] In certain embodiments, the enclave-aware loader 146 may evaluate the trust policy before loading a protected section 156 into a trusted execution environment 326 or before initializing the trusted execution environment, and an eABI-aware runtime 180 may evaluate the trust policy before permitting symbol resolution, note 212 processing, control transfer, data exchange, selected data security mode 374 use, or other eABI-mediated interoperability.

[0489] A trust policy 386 may be evaluated at load time, initialization time, runtime, note-processing time, control transfer time, data exchange time, symbol resolution time, or combinations thereof.

[0490] A trust policy 386 evaluated at one time may differ from a trust policy evaluated at another time. For example, a trust policy evaluated when an executable file was loaded may differ from a trust policy evaluated during execution. An enclave-aware loader, eABI-aware runtime, or policy component may reevaluate the trust policy and update a trust determination, eABI participation status, operation-specific permission, data security mode constraint, or combinations thereof.

[0491] A “policy component” refers to software, firmware, hardware, metadata, configuration information, executable code, runtime logic, loader logic, operating system logic, kernel logic, trusted execution environment logic, or combinations thereof configured to evaluate, enforce, communicate, determine, apply, update, or otherwise participate in application of a trust policy. A policy component may determine one or more allowed data security modes 376, evaluate trust information, evaluate a trust policy 386, evaluate provenance information 380, evaluate a certificate validation result 378, determine a selected data security mode 374, authorize or deny a control transfer 214, authorize or deny a data exchange 312, or combinations thereof. A policy component may be implemented within an enclave-aware loader 146, eABI-aware runtime 180, operating system 148, trusted execution environment 326, kernel service interface 414, kernel-resident trusted execution environment 416, loaded executable 364, or combinations thereof.

[0492] “Production mode”174 refers to an operating state, configuration state, policy state, platform state, firmware state, administrative setting, enterprise setting, user setting, application setting, or combinations thereof that indicates whether trust requirements are to be enforced before loading, initializing, registering, executing, or permitting eABI-mediated interoperability involving an eABI-aware executable 112, enclave-aware executable file 264, protected section 156, loaded executable 364, or combinations thereof.

[0493] In certain embodiments, production mode 174 may be represented by one or more state indicators, configuration bits, policy values, registry values, firmware settings, enterprise policy settings, loader flags, deployment mode values, or combinations thereof.

[0494] When the production mode 174 has an “active state”178, the enclave-aware loader 146, operating system 148, hypervisor 226, firmware component, or combinations thereof enforces governed launch authorization before loading a protected section 156 into a trusted execution environment 326.

[0495] When the production mode 174 has an “active state”178, the eABI-aware runtime may require satisfaction of a trust policy 386 before allowing control transfer, data exchange, selected data security mode 374 use, or other eABI-mediated interoperability.

[0496] In certain embodiments, when production mode 174 is in an active state 178 and the certificate validation result derived from an enclave-aware executable file 264, protected section 156, or loaded executable 364 does not satisfy a trust policy 386, an enclave-aware loader 146 may prevent loading of the protected section into a trusted execution environment 326, prevent formation of a loaded enclave-aware executable 268, prevent initialization of the trusted execution environment, prevent registration for eABI-mediated interoperability, prevent control transfer or data exchange involving the loaded eABI-aware executable 240, prevent use of one or more selected data security modes 374, or combinations thereof.

[0497] “Development use” refers to the use of an executable for development, testing, debugging, evaluation, recovery, education, profiling, another non-production mode, or combinations thereof while production mode 174 is not in the active state 178.

[0498] In certain embodiments, when production mode 174 is not in an active state 178, an enclave-aware loader 146 may permit loading of an unsigned executable file 190, untrusted executable file, executable file having an untrusted certificate chain 388, or combinations thereof. The enclave-aware loader may record a trust status, development status, restriction status, eABI participation status, or combinations thereof associated with the executable file or with a loaded executable 364 formed from the executable file (FIG. 53). The recorded status may indicate that the loaded executable is untrusted, development-only, restricted, ineligible for selected operations according to the eABI 114, ineligible to publish certain symbols, ineligible to satisfy certain external symbol dependencies 184, ineligible to send or receive certain notes 212, ineligible for certain selected data security modes 374, or combinations thereof. In such an embodiment, when the certificate chain does not satisfy the trust policy 386, the enclave-aware loader may generate a trust determination indicating that loading of the protected section 156 is permitted for development, testing, debugging, evaluation, recovery, education, profiling, another non-production mode, or combinations thereof. The enclave-aware loader may store or make available the trust determination and the recorded trust status as runtime information associated with a loaded enclave-aware executable 268 formed from the executable file.

[0499] “Provenance information”380 may identify a publisher, developer, user, organization, vendor, signing authority, executable family, executable version, executable identity, protected section identity, certificate policy, permitted use, distribution channel, product line, or combinations thereof. An enclave-aware loader 146, eABI-aware runtime 180, operating system 148, hypervisor 226, or combinations thereof may evaluate the provenance information as part of a trust policy 386 to determine whether loading, initialization, control transfer, data exchange, selected data security mode 374 use, or other eABI-mediated interoperability is permitted.

[0500] Certificate-based public key infrastructure 172 may be used to determine whether a certificate chain 388 satisfies a trust policy 386, a protected section 156 is authorized for loading, production mode 174 permits governed launch, or a loaded executable 364 may participate in one or more eABI operations.

[0501] A “certificate”168 is a signed, cryptographically verifiable, or authenticated data structure binding identity, provenance information 380, a public key or identifier, enclave-compatible key 170, executable or protected section identity, signing identity, policy, permitted use, or combination thereof to an executable, protected section, trusted execution environment, publisher, developer, organization, or signing authority. It may be embedded in, appended to, referenced by, or otherwise associated with an eABI-aware executable, eABI metadata 246, signature block, or key information and used for trust, governed launch, provenance, mode, or participation decisions.

[0502] In certain embodiments, a certificate 168 associated with an enclave-aware executable file 264, protected section 156, enclave-compatible cryptographic key 170, or combinations thereof may include provenance information 380, identity information, attribution information, or combinations thereof.

[0503] “Signed section information” is a value or data structure corresponding to a protected section 156 and digitally signed, bound, or otherwise cryptographically associated with a certificate 168. It may include a hash, measurement, or section manifest generated over bytes, pages, relocation-adjusted content, section attributes, permissions, eABI metadata 246, a protected section, or combinations thereof.

[0504] Signed section information (FIG. 15) may be included in, referenced by, or authenticated through a certificate 168 or certificate chain 388. A certificate chain may satisfy a trust policy 386 only when the signed information corresponds to the protected section 156 being loaded and the chain validates to an accepted trusted root 390 (FIG. 53).

[0505] A “certificate chain”388 is an ordered or otherwise verifiable set of certificates 168 linking an end-entity certificate associated with an executable, protected section 156, key, publisher, or other identity to a trusted root certificate 390 or trust anchor. The chain may include intermediate and root certificates, policy and usage information, validity and revocation information, timestamps, signatures 228, public keys, or combinations thereof.

[0506] “Certificate chain validation” may include verifying signatures, validity periods, usage and policy constraints, integrity, revocation, timestamps, trusted root status, provenance information 380, and combinations thereof.

[0507] A “certificate usage constraint” identifies or limits a permitted, prohibited, required, or intended use of a certificate 168, public key or identifier, enclave-aware executable file 264, protected section 156, or combination thereof. A trust policy 386 may require the applicable usage constraint before permitting loading, initialization, registration, or another eABI operation.

[0508] “Trusted root certificates”390 include certificates, public keys or identifiers, trust anchors, root certificate authority certificates, and enterprise-, administrator-, system-, firmware-, or user-designated roots recognized by a public key infrastructure 172 or trust policy 386. They may be maintained in a certificate, policy, firmware, enterprise, operating system, deployment, hardware security module, or trusted platform store.

[0509] A certificate chain 388 satisfies a trusted root requirement when an associated root certificate, intermediate certificate, public key, identifier, or other trust anchor corresponds to an accepted trusted root 390. A trust policy 386 may combine that requirement with publisher, usage, policy, provenance, production mode, or other conditions for loading, initialization, registration, eABI participation, or data security mode use.

[0510] For example, a trust policy 386 may permit loading a protected section 156 only when the certificate chain 388 terminates at an accepted trusted root 390, provenance information 380 identifies an authorized publisher or organization, the certificate 168 satisfies a loading-related usage constraint, and the certificate is not revoked. The enclave-aware loader 146 evaluates each required condition when generating the trust determination.

[0511] “Certificate validation result”378 refers to information representing, recording, or resulting from validation of certificate 168 information associated with an eABI-aware executable file 238, protected section 156, enclave-compatible cryptographic key 170, trusted execution environment 326, or combinations thereof. A certificate validation result may include certificate validity status, certificate chain validation result, revocation status, certificate usage status, certificate policy status, certificate signature status, trusted root status, integrity status, timestamp status, or combinations thereof. A certificate validation result may further describe a state, condition, usability, trustworthiness, expiration state, policy-compliance state, issuance state, or combinations thereof associated with a certificate or certificate chain 388.

[0512] In certain embodiments, a certificate validation result 378 may be generated by validating a certificate chain 388 including a certificate 168 associated with an enclave-aware executable file 264, a protected section 156, an executable portion, a publisher, a developer, an organization, a vendor, a signing authority, or combinations thereof. The certificate validation result may indicate whether the certificate chain is valid, invalid, expired, revoked, incomplete, untrusted, stale, malformed, policy-incompatible, or otherwise acceptable or unacceptable according to certificate validation criteria.

[0513] In certain embodiments, validating a certificate chain 388 may include verifying that each certificate signature in the certificate chain is valid, that each certificate is within a validity period, that the certificate chain terminates at or otherwise corresponds to a trusted root certificate 390, that a certificate usage or certificate policy permits loading into a trusted execution environment, that the certificate has not been revoked, that a timestamp satisfies a trust policy, that provenance information satisfies a publisher allowlist, denylist, or other provenance requirement, and that an executable identity or protected section identity in the certificate information corresponds to the enclave-aware executable file or protected section being loaded.

[0514] “eABI trust evidence”382 refers to certificate information, provenance information 380, certificate validation result 378, attestation information, cryptographic key information, trusted root information, trust policy information, or combinations thereof presented, accessed, obtained, generated, or derived for validation under a trust policy 386 to support governed launch, trust determination, eABI 114 participation, selected data security mode 374 use, or combinations thereof.

[0515] A “trust determination” refers to a result of evaluating eABI trust evidence associated with an eABI-aware executable 112 or protected section 156. A trust determination may indicate whether loading, initialization, governed launch, eABI 114 participation, data exchange, selected data security mode 374 use, or other eABI-mediated interoperability are permitted, restricted, denied, or conditioned. By way of non-limiting example, a trust determination may indicate that a loaded eABI-aware executable 240 is trusted, untrusted, partially trusted, development-only, restricted, enterprise-approved, publisher-approved, certificate-validated, policy-limited, or combinations thereof.

[0516] In certain embodiments, a trust determination may include a certificate validation result 378, attestation validation result, measurement validation result, signature validation result, manifest validation result, provenance validation result, key-identity validation result, policy-compliance result, or combination thereof. eABI trust evidence may be evaluated with a trust policy 386 to generate a trust determination. When a production mode is in an active state, an enclave-aware loader may load a protected section into a trusted execution environment, initialize the trusted execution environment, or both only when the trust determination indicates that the corresponding loading, initialization, or both is permitted.

[0517] In certain embodiments, a trust determination may include one or more permit, deny, restrict, defer, or reason-code fields corresponding to loading a protected section into a trusted execution environment, initializing the trusted execution environment, registering a loaded enclave-aware executable for eABI-mediated interoperability, publishing symbols, satisfying external symbol dependencies, sending or receiving notes, using one or more selected data security modes, or combinations thereof. The enclave-aware loader 146, eABI-aware runtime 180, loaded executable 364, or combinations thereof may store or access the trust determination as runtime information associated with a loaded enclave-aware executable 268.

[0518] An “operation-specific permission” refers to information, a field, flag, status, reason code, policy result, or other value indicating whether a particular operation is permitted, denied, restricted, deferred, or conditioned. An operation-specific permission may correspond to loading a protected section 156, initializing a trusted execution environment 326, registering a loaded enclave-aware executable 268 for eABI-mediated interoperability, publishing or accessing a published symbol 194, satisfying an external symbol dependency 184, processing a note 212, performing control transfer 214 or data exchange 312, using a selected data security mode 374, or combinations thereof. Before performing an operation represented by a corresponding permission field, the enclave-aware loader 146 may access and apply the operation-specific permission. The system may execute the operation only when the respective permission field indicates that the corresponding operation is permitted.

[0519] “Comparison information” is information derived from a protected section 156 for comparison with signed section information, including a recomputed digest, measured value, parsed manifest information, bytes, pages, relocation-adjusted content, attributes, permissions, entry point information, eABI metadata 246, protected section identity information, or combinations thereof. The enclave-aware loader 146 may compare the information before authorizing loading.

[0520] To verify section correspondence, the enclave-aware loader 146 may recompute a digest, measure a protected section 156, parse a signed section manifest, or otherwise derive comparison information and compare it with a signed digest, hash, measurement, or manifest covering the protected section bytes, pages, relocations, attributes, permissions, entry points, eABI metadata 246, identity information, or combinations thereof.Kernel-Resident Trusted Execution Environments

[0521] The following terms describe kernel-resident trusted execution environments 416, kernel-resident enclaves 402, isolated kernel code 418, isolated kernel resources 412, kernel service interfaces 414, and eABI-mediated access to protected kernel functionality (FIGS. 54-55).

[0522] In certain embodiments, a trusted execution environment (TEE) 326 may be instantiated, initialized, mapped, loaded, reserved, scheduled, or otherwise made available for use by an operating system 148 kernel, kernel component, kernel service, device driver, kernel module, hypervisor 226, secure monitor, firmware component, boot component, privileged service, or combinations thereof. The described structures may allow selected kernel resources to be maintained inside a TEE while permitting controlled access through defined kernel service interfaces 414 according to binary-level semantics defined by the eABI.

[0523] A “kernel-resident trusted execution environment”416 (FIGS. 54-55) generally refers to a trusted execution environment 326 instantiated, initialized, mapped, loaded, reserved, scheduled, associated with, controlled by, made available for use by, or used on behalf of an operating system 148 kernel, kernel component, kernel service, device driver, kernel module, hypervisor 226, secure monitor, firmware component, boot component, privileged service, or combinations thereof. A trusted execution environment may be kernel-resident by virtue of such association, control, use, or availability, by virtue of maintaining, controlling, protecting, or mediating access to an isolated kernel resource 412, or both. Unless expressly stated otherwise, a kernel-resident trusted execution environment need not require that all processor instructions associated with the trusted execution environment execute at a kernel privilege level or that all memory associated with the trusted execution environment be mapped only in kernel address space. Isolated kernel code 418 may execute within or through the kernel-resident trusted execution environment to maintain, access, validate, modify, use, protect, or mediate access to an isolated kernel resource.

[0524] In certain embodiments, a trusted execution environment 326 may be instantiated, maintained, or operated within an operating system kernel, kernel address space, kernel memory, privileged execution layer, hypervisor layer, secure monitor layer, or combinations thereof. Such a trusted execution environment may be referred to as a kernel-resident trusted execution environment. A kernel-resident trusted execution environment may isolate isolated kernel code, an isolated kernel resource, a protected kernel entry point 408, a kernel service, a kernel policy, a kernel secret, kernel state, or combinations thereof from kernel code outside the kernel-resident trusted execution environment, device drivers, kernel modules, user processes, hypervisors, privileged software, direct memory access, debugging software, introspection software, or combinations thereof.

[0525] In certain embodiments, a request involving a kernel-resident trusted execution environment 416 may correspond to a kernel-to-hypervisor communication, hypervisor-to-kernel communication, secure-monitor communication, hypercall request, virtual machine exit parameter, virtual machine entry parameter, memory sharing request, device assignment request, attestation request, or combinations thereof. The request may be represented in a kernel note 410, routable envelope 272, protected payload 276, eABI metadata 246, or combinations thereof and may be routed toward a kernel service interface 414 according to the eABI 114.

[0526] A computing environment may include one or more kernel-resident trusted execution environments 416, each maintaining one or more isolated kernel resources 412 and isolated kernel code 418. Kernel code outside such an environment, device drivers, kernel modules, usermode processes 150, hypervisors 226, privileged management components, or direct memory access mechanisms may be prevented from directly accessing the isolated resource except through the associated kernel service interface 414 and its policy and controlled entry mechanisms.

[0527] A “kernel-resident enclave”402 (FIGS. 54-55) refers to a specialized kernel-resident trusted execution environment 416 instantiated, initialized, mapped, loaded, reserved, or otherwise made available for use by an operating system 148 kernel, kernel component, device driver, kernel module, hypervisor 226, secure monitor, firmware component, or combinations thereof. A kernel-resident enclave may be an enclave 104 that is created and managed by the kernel even if the enclave runs in userspace. Isolated kernel code 418 may execute within the kernel-resident enclave to mediate access to an isolated kernel resource 412 according to the eABI 114.

[0528] “Isolated kernel resource”412 (FIG. 54) refers to a kernel data structure, kernel state, kernel secret, kernel control structure, credential object, access control object, cryptographic key, process table entry, memory-management object, page table, security token, namespace object, filesystem object, device object, attestation state, hypervisor-facing communication state, network stack object, scheduling object, system call object, or combinations thereof maintained within, controlled by, protected by, or accessible through a kernel-resident trusted execution environment 416. An isolated kernel resource may be accessed, modified, validated, used, or otherwise acted upon through a kernel service interface 414 according to the eABI 114.

[0529] “Isolated kernel code”418 (FIGS. 54-55) is processor instructions or executable code associated with an operating system kernel and configured to execute in or through a kernel-resident trusted execution environment 416 or kernel-resident enclave 402 to maintain, use, protect, or mediate access to an isolated kernel resource 412. It may include or be associated with a protected kernel entry point 408, protected section 156, defined entry points 262, published symbols 194, request handlers, and note, system call, driver-, module-, hypervisor-, or metadata-defined interfaces.

[0530] Isolated kernel code 418 may be generated from generic, enclave-aware, kernel, driver, or service source code by an enclave-aware compiler 122, a kernel build system, or a combination thereof. The enclave-aware compiler, kernel build system, or combination thereof may generate an eABI-kernel executable.

[0531] An “eABI-kernel executable” is an executable or object file, library 328, kernel module, driver or service, protected section 156, metadata, package, or combination thereof from which isolated kernel code 418 is loaded, established, linked, mapped, or otherwise formed. It may include or be associated with eABI metadata 246 identifying a published kernel-service symbol, defined entry point 262, kernel service interface 414, isolated kernel resource 412, request and return representations, trust information, policy information, or combinations thereof.

[0532] “Kernel service interface”414 (FIGS. 54-55) is an eABI-defined controlled-access surface associated with a kernel-resident trusted execution environment 416 or kernel-resident enclave 402 and configured to mediate access to isolated kernel code 418 or an isolated kernel resource 412. It may include defined entry points 262, published symbols 194, request handlers, note or system call 232 interfaces, driver-, module-, or hypervisor-facing interfaces, metadata-defined interfaces, or combinations thereof.

[0533] The kernel service interface 414 may receive an eABI-defined request and cause isolated kernel code 418 to process it within the kernel-resident trusted execution environment 416. Kernel code, drivers, modules, usermode processes 150, hypervisors 226, or other components outside the environment may be restricted from accessing the isolated kernel resource 412 except through the interface.

[0534] A “kernel service” is a function, operation, request handler, device driver or operating system service, credential or cryptographic operation, policy operation, isolated-resource operation, or combination thereof performed by or through isolated kernel code 418, a kernel service interface 414, or a kernel-resident trusted execution environment 416.

[0535] A “published kernel-service symbol” is a published symbol 194 corresponding to a kernel service and exposed or made resolvable under the eABI 114 through a kernel service interface 414, isolated kernel code 418, or combination thereof. It may correspond to one or more defined entry points 262.

[0536] An enclave-aware compiler 122 or kernel build system may generate kernel service interface metadata identifying a kernel service interface 414, protected kernel entry point 408, isolated kernel code 418, isolated kernel resource 412, request and return formats, symbol resolution and entry point information, candidate data security modes, policy information, validation information, or combinations thereof.

[0537] In certain embodiments, an isolated kernel resource may include a cryptographic key or credential used by isolated kernel code 418 to perform encryption, decryption, signing, authentication, key derivation, or credential validation. The key or credential and sensitive request data remain unavailable in unprotected form outside the kernel-resident trusted execution environment 416, except for authorized representations conveyed according to the eABI 114.

[0538] In certain embodiments, a protected communication path between a trusted execution environment associated with a usermode process and a kernel-resident trusted execution environment may be implemented using one or more kernel notes, protected payloads, routable envelopes, transit buffers, selected data security modes, cryptographic support information, validation information, or combinations thereof according to the eABI (FIG. 54). The protected communication path may transfer system call parameters, sensitive buffers, cryptographic material, authentication tokens, policy requests, or combinations thereof (FIG. 50).

[0539] In certain embodiments, before protected interoperability between a first trusted execution environment associated with a usermode process and a second trusted execution environment associated with an operating system kernel, the system validates an identity, measurement, or trust status of each trusted execution environment and of each calling and called executable using a certificate, eABI trust evidence, provenance information, or a combination thereof. The system establishes or derives first and second enclave-compatible session keys usable within the first and second trusted execution environments, respectively. The first and second enclave-compatible session keys may comprise respective copies of a shared symmetric key, respective keys derived from a common secret, corresponding asymmetric keys, or a combination thereof. The session keys may be cryptographically bound to one or more validated identities, validated measurements, a published symbol, a kernel service, an invocation identifier, or a combination thereof. Neither session key is made available in unprotected form to a routing component or to kernel code outside the second trusted execution environment. Dispatch of an outbound kernel note is permitted only when the validated identities, measurements, or trust statuses satisfy an applicable trust policy. The calling executable may protect an outbound protected payload using the first enclave-compatible session key, and the called executable may protect a corresponding return payload using the second enclave-compatible session key.

[0540] During initialization of a kernel-resident trusted execution environment 416, a kernel loader, boot component, firmware component, secure-monitor component, hypervisor 226, operating system initialization component, or combinations thereof may make available published symbol information, kernel service interface 414 information, protected kernel entry point 408 information, policy information, selected data security mode information, candidate data security mode information, allowed data security mode information, validation information, or combinations thereof to loaded executables outside the kernel-resident trusted execution environment, isolated kernel code 418, the kernel service interface, the operating system 148 kernel, or combinations thereof.

[0541] A kernel service interface 414 may include executable, kernel, authentication, service, or policy-enforcement code configured to process requests involving isolated kernel resources 412 according to the eABI 114.

[0542] The eABI 114 may define symbol resolution and controlled entry semantics that resolve an external symbol dependency 184 to a published kernel service symbol and permit access only through the corresponding kernel service interface 414 and defined entry point 262.

[0543] In certain embodiments, a kernel service interface 414 may mediate access to an isolated kernel resource maintained within a kernel-resident trusted execution environment. The kernel service interface may receive a request according to binary-level semantics defined by the eABI 114, validate the request, route the request to isolated kernel code executing within the kernel-resident trusted execution environment via a protected kernel entry point 408, receive result information from the isolated kernel code, and return the result information according to the eABI. The request may correspond to access to, modification of, validation of, use of, execution of, or policy evaluation associated with the isolated kernel resource.

[0544] The kernel service interface 414 may expose defined entry points, request handlers, and note interfaces according to the eABI 114. A kernel note 410 may include a routable envelope identifying the kernel service interface, destination trusted execution environment, requested operation, boundary class, selected data security mode, or routing information, and a protected payload containing symbol, argument, buffer descriptor, validation, return, or other request information interpretable by isolated kernel code 418.

[0545] A processor 106 and kernel-resident trusted execution environment 416 may enforce memory-access, controlled-entry, controlled-return, and policy restrictions that prevent kernel code, drivers, modules, usermode processes 150, hypervisors 226, privileged management or debugging software, and direct memory access mechanisms outside the environment from directly reading, writing, modifying, using, invoking, calling, dereferencing, mapping, copying, exposing, or otherwise accessing an isolated kernel resource 412 except through a kernel service interface 414 and a defined entry point 262, protected kernel entry point 408, or other controlled entry mechanism according to the eABI 114. Kernel code outside the kernel-resident trusted execution environment may possess a descriptor, handle, reference, routable-envelope field, routing identifier, or service identifier associated with the isolated kernel resource or a kernel service without having direct access to the isolated kernel resource itself. An attempted access that bypasses the kernel service interface, bypasses a defined entry point, fails validation, violates a selected data security mode requirement, or violates a policy associated with the isolated kernel resource may be rejected, trapped, denied, audited, rate-limited, or handled under a violation policy.

[0546] A policy for an isolated kernel resource 412 may evaluate caller or execution environment identity, measurements, certificates, attestation, provenance, trust determinations, data security mode requirements, operation-specific permissions, rate limits, and audit requirements. Before acting on the resource, isolated kernel code 418 may permit, deny, restrict, condition, or audit the kernel service and may return result, denial, audit, or status information under the return semantics.

[0547] The eABI 114 may define binary-level semantics for a request or return involving a kernel-resident trusted execution environment 416 or kernel-resident enclave 402, including a syscall note 306 or kernel note 410 format, argument and return representations, routing information, controlled entry and validation requirements, and data security mode requirements for a kernel service interface 414.

[0548] A “kernel note”410 (FIGS. 50 and 54-55) is a specialized note 212, syscall note 306, or intra-kernel message formed or processed according to the eABI 114 for a request or return involving a kernel service interface 414, isolated kernel code 418, or an isolated kernel resource 412. A kernel note may contain routing, request, symbol, argument, referenced-data, return, validation, and selected data security mode information.

[0549] A kernel note 410 may be dispatched, routed, delivered, validated, decrypted, authenticated, processed, and returned according to the eABI 114. Its routable envelope 272 may be visible to an eABI-aware runtime 180, operating system 148, hypervisor 226, kernel routing code, eABI-common executable 208, executable-side routing functionality, processor-supported transfer functionality, or other routing component, while its protected payload 276 remains interpretable only by authorized code in the destination trusted execution environment. Routing may include forwarding, relaying, copying, transferring, or causing transfer of a kernel note or return kernel note using routing information in the routable envelope, and need not expose the requested kernel service, symbol information, protected request data, or return data in unprotected form. In some embodiments, the routing component receives or copies a kernel note through common memory or a transit buffer. In other embodiments, the routing component supplies destination, permission, trust, target execution environment information 266, selected-data-security-mode, cryptographic-support, or return-routing information to a processor-supported direct note-transfer mechanism without receiving, copying, decrypting, or interpreting the protected payload or return payload.

[0550] A return kernel note may contain an integrity value binding its routable envelope to its return payload and may include an invocation identifier, note identifier, return-path identifier, caller-encrypted execution context 420, nonce, sequence value, session identifier, or combination thereof that correlates the return kernel note with an outbound kernel note. Before acting on an isolated kernel resource 412, the destination may validate applicable integrity, nonce, sequence, timestamp, freshness, one-time-use, policy, or selected-data-security-mode values. After validating the return kernel note, the calling executable, calling-side runtime functionality, or trusted execution environment associated with the calling executable may compare the correlation value with saved invocation state associated with the outbound kernel note and apply return data only to the invocation or data location associated with the saved invocation state. Return data may include a return value, result information, return status information, error information, denial information, audit information, output buffer data, modified referenced data, or combinations thereof, and modified referenced data may be applied only to a location identified by function signature information, eABI metadata 246, compiler-generated return instructions, saved invocation state, or a combination thereof.

[0551] A kernel note 410 or syscall note 306 may be processed under a selected data security mode 374 (FIG. 39) chosen from candidate modes supported by the participating executable, isolated kernel code 418, kernel service interface 414, or isolated kernel resource 412 and modes allowed by applicable policy.

[0552] The kernel-resident-TEE embodiments may be combined with the eABI, compiler, executable, loader, runtime, symbol-resolution, note, data security mode, governed-launch, registration, restricted operation, and direct-transfer embodiments described in this disclosure.

[0553] In certain embodiments, enclave-aware compiled files, enclave-aware loading, runtime-mediated or direct note transfer, and eABI-defined semantics automate executable-level placement, protected loading, and controlled communication without requiring programmer-authored enclave-management logic.

[0554] The disclosed systems, methods, and non-transitory computer-readable media may combine the compiler, loader, runtime, executable, note, data security mode, trust, restricted operation, and kernel-resident-TEE mechanisms described herein. Each combination rema...

Claims

1. A system for performing a restricted operation in support of executable content operating in a trusted execution environment, the system comprising:a processor configured to support the trusted execution environment and to enforce an execution restriction that prevents at least one restricted instruction from being executed within the trusted execution environment; andmemory in communication with the processor, the memory maintaining:the trusted execution environment;common memory outside the trusted execution environment;a first loaded eABI-aware executable operating at least partly within the trusted execution environment, the first loaded eABI-aware executable being a loaded enclave-aware executable; anda second loaded eABI-aware executable operating within the common memory, the second loaded eABI-aware executable being a loaded eABI-common executable;wherein an enclave-aware application binary interface (eABI), embodied at least by first eABI metadata associated with the first loaded eABI-aware executable, second eABI metadata associated with the second loaded eABI-aware executable, and processor instructions of the first loaded eABI-aware executable and the second loaded eABI-aware executable, defines binary-level semantics for interoperability across a boundary of the trusted execution environment, the binary-level semantics including restricted-operation request semantics, data transfer semantics, symbol resolution semantics, controlled entry point semantics, and return semantics;wherein the first eABI metadata identifies an external symbol dependency corresponding to the restricted operation;wherein the second eABI metadata identifies a published symbol and a defined entry point corresponding to processor instructions of the second loaded eABI-aware executable configured to perform the restricted operation;wherein the symbol resolution semantics require the external symbol dependency to be resolved to the published symbol based at least on matching function signature information associated with the external symbol dependency and the published symbol, the function signature information identifying argument order information, argument datatype information, pointer or reference properties, and return datatype information;wherein, for an invocation of the external symbol dependency by processor instructions of the first loaded eABI-aware executable executing within the trusted execution environment, the first loaded eABI-aware executable is a calling executable and the second loaded eABI-aware executable is a called executable;wherein the calling executable is configured, responsive to the invocation, to:select, according to the data transfer semantics and based at least on the function signature information, call data corresponding to the invocation, the selected call data comprising a representation of protected data maintained within the trusted execution environment and corresponding to one or more arguments of the invocation; andissue, according to the restricted-operation request semantics, a restricted-operation request for performance of the restricted operation while making the selected call data available outside the trusted execution environment to the called executable;wherein the called executable is configured to:receive the restricted-operation request and the selected call data;process the restricted-operation request according to the controlled entry point semantics by transferring control only to the defined entry point corresponding to the published symbol and preventing the restricted-operation request from causing control transfer to an arbitrary address within the called executable;perform, within the common memory and using the selected call data, the restricted operation, wherein the restricted operation is unavailable or disallowed within the trusted execution environment and is performed using a restricted instruction, a system call, a standard library service, or an operating system interface; andform return information including result information according to the return semantics;wherein the called executable performs the restricted operation without directly accessing protected data maintained within the trusted execution environment that is neither included in nor represented by the selected call data; andwherein the calling executable is configured to receive the return information and apply the result information to the invocation.

2. The system of claim 1, wherein executable content of the calling executable and executable content of the called executable are generated by an enclave-aware compiler from one or more portions of generic source code, the generic source code including a source-language invocation corresponding to the restricted operation and omitting, for the source-language invocation, an enclave-specific interface definition, an enclave-specific call declaration, an explicit enclave lifecycle call, a manually written trusted execution environment transition wrapper, and explicit marshaling code.

3. The system of claim 2, wherein the enclave-aware compiler is configured to:identify a portion of the generic source code corresponding to the restricted operation;translate the identified portion into an eABI-common executable file from which at least part of the called executable is formed; andgenerate, within or associated with the eABI-common executable file, processor instructions configured to perform the restricted operation, eABI metadata identifying the published symbol and the defined entry point, and data transfer metadata usable in selecting the selected call data.

4. The system of claim 2, wherein a single enclave-aware executable file includes:a protected section from which at least a portion of the calling executable is formed;an unprotected executable section from which at least a portion of the called executable is formed; andeABI metadata identifying the trusted execution environment as a target execution environment for the protected section and identifying the common memory as a target execution environment for the unprotected executable section.

5. The system of claim 2, wherein:the calling executable is formed from at least a portion of an enclave-aware executable file;the called executable is formed from at least a portion of an eABI-common executable file; andthe enclave-aware executable file and the eABI-common executable file are separate executable files.

6. The system of claim 1, further comprising an enclave-aware loader configured to:analyze eABI metadata included in or associated with one or more executable files;establish or initialize the trusted execution environment;load a protected section identified by the eABI metadata into the trusted execution environment to form at least part of the calling executable; andload an unprotected executable section identified by the eABI metadata into the common memory to form at least part of the called executable.

7. The system of claim 1, wherein the symbol resolution semantics require matching the external symbol dependency to the published symbol using at least a symbol hash, a boundary class, a function prototype, and an eABI version.

8. The system of claim 1, wherein the selected call data comprises one or more of:a direct argument value;copied data referenced by an argument;a handle;a descriptor;a sanitized representation of data referenced by an argument;a shallow-copy representation;a deep-copy representation;a copy-in representation;a copy-out representation; anda copy-in / copy-out representation selected according to the function signature information.

9. The system of claim 8, wherein protected data maintained within the trusted execution environment that is neither represented by an argument of the invocation nor selected for transfer according to the first eABI metadata is excluded from the selected call data and remains inaccessible to the called executable.

10. The system of claim 8, wherein:the selected call data includes a descriptor identifying a copy-out transfer or a copy-in / copy-out transfer associated with a protected data object maintained within the trusted execution environment;the return information includes modified-data information, output-buffer data, or both corresponding to the descriptor; andthe calling executable is configured, after receiving the return information, to update the protected data object within the trusted execution environment according to the return semantics using the modified-data information, the output-buffer data, or both.

11. The system of claim 1, further comprising an eABI-aware runtime, wherein:the restricted-operation request comprises an outbound note including an invocation identifier, a routable envelope containing routing information identifying the called executable, the common memory, or both, and a common payload containing the selected call data;the calling executable is configured to dispatch the outbound note out of the trusted execution environment;the eABI-aware runtime is configured to route the outbound note toward the called executable by consulting the routable envelope;the called executable is configured to deliver the outbound note as an inbound note, process the common payload, perform the restricted operation, and dispatch a return note including the invocation identifier or a corresponding return-path identifier and a return payload containing the result information;the eABI-aware runtime is configured to route the return note toward the trusted execution environment; andthe calling executable is configured to deliver the return note by correlating the return note with the outbound note based on the invocation identifier or the corresponding return-path identifier.

12. The system of claim 11, wherein:the routable envelope includes a source identifier, target identifier, execution environment identifier, boundary class identifier, dispatch flag, note size, return path information, selected data security mode identifier, transit buffer identifier, runtime routing field, or combinations thereof; andthe common payload includes direct argument information, copied referenced data, a descriptor, shallow-copy information, deep-copy information, copy-in transfer information, copy-out transfer information, copy-in / copy-out transfer information, buffer length information, bounds information, ownership information, mutability information, or combinations thereof.

13. The system of claim 11, wherein the return note includes a nonce, one-time-use value, freshness value, sequence value, monotonic counter, timestamp, random value, session identifier, return path identifier, note identifier, invocation identifier, or combinations thereof that correlate the return note to the outbound note or bind the return note to a particular invocation, session, source execution environment, target execution environment, or loaded executable.

14. The system of claim 1, wherein the restricted operation comprises an operating system interface operation, system call operation, filesystem operation, network operation, memory management operation, time operation, hardware-resource operation, processor-identification operation, I / O operation, standard library operation, hypervisor call operation, privileged instruction operation, operation modifying system state, operation requiring execution outside the trusted execution environment, or combinations thereof.

15. The system of claim 1, wherein the loaded eABI-common executable implements a common memory service configured to receive respective eABI-mediated requests from a plurality of loaded enclave-aware executables operating at least partly within respective trusted execution environments and to perform one or more restricted operations on behalf of the plurality of loaded enclave-aware executables.

16. The system of claim 1, wherein eABI-mediated access to the restricted operation, the published symbol, control transfer to the defined entry point, data exchange involving the selected call data, or combinations thereof is permitted, restricted, or validated based on published symbol information, external symbol dependency information, loaded executable identity, execution environment, trust determination, selected data security mode, policy, operation-specific permission, or combinations thereof.

17. The system of claim 1, wherein the data transfer semantics require the selected call data to be conveyed according to a selected data security mode selected from modes supported by the calling executable and the called executable and permitted by a policy, the selected data security mode comprising plaintext mode, validation mode, encryption mode, secure mode, max mode, encryption-with-validation mode, or combinations thereof, and wherein, when the selected data security mode comprises plaintext mode, the policy authorizes the selected call data to be conveyed outside the trusted execution environment without encryption.

18. A computer-implemented method for performing a restricted operation in support of executable content operating in a trusted execution environment, the method comprising:maintaining, in memory in communication with a processor configured to support the trusted execution environment and to enforce an execution restriction that prevents at least one restricted instruction from being executed within the trusted execution environment:the trusted execution environment;common memory outside the trusted execution environment;a calling executable comprising a loaded enclave-aware executable operating at least partly within the trusted execution environment; anda called executable comprising a loaded eABI-common executable operating within the common memory;applying an enclave-aware application binary interface (eABI) defining binary-level semantics for interoperability across a boundary of the trusted execution environment, the binary-level semantics including restricted-operation request semantics, data transfer semantics, symbol resolution semantics, controlled entry point semantics, and return semantics;resolving, according to the symbol resolution semantics, an external symbol dependency of the calling executable to a published symbol of the called executable based at least on matching function signature information associated with the external symbol dependency and the published symbol, the published symbol corresponding to a defined entry point of the called executable;responsive to an invocation of the external symbol dependency by processor instructions of the calling executable executing within the trusted execution environment, selecting, according to the data transfer semantics and based at least on the function signature information, selected call data comprising a representation of protected data maintained within the trusted execution environment and corresponding to one or more arguments of the invocation;issuing, by the calling executable and according to the restricted-operation request semantics, a restricted-operation request while making the selected call data available outside the trusted execution environment to the called executable;receiving, by the called executable, the restricted-operation request and the selected call data;processing, by the called executable, the restricted-operation request according to the controlled entry point semantics by transferring control only to the defined entry point corresponding to the published symbol and preventing the restricted-operation request from causing control transfer to an arbitrary address within the called executable;performing, by the called executable within the common memory and using the selected call data, the restricted operation, wherein the restricted operation is unavailable or disallowed within the trusted execution environment and is performed using a restricted instruction, a system call, a standard library service, or an operating system interface, without directly accessing protected data maintained within the trusted execution environment that is neither included in nor represented by the selected call data;forming, by the called executable, return information including result information according to the return semantics;receiving, by the calling executable, the return information; andapplying, by the calling executable, the result information to the invocation.

19. The method of claim 18, wherein:the calling executable and the called executable are formed from one or more executable files generated by an enclave-aware compiler from generic source code including a source-language invocation corresponding to the restricted operation, the generic source code omitting, for the source-language invocation, an enclave-specific interface definition, an enclave-specific call declaration, an explicit enclave lifecycle call, a manually written trusted execution environment transition wrapper, and explicit marshaling code; andeABI metadata of at least one of the one or more executable files is generated by the enclave-aware compiler based at least on function signature information associated with the source-language invocation, the eABI metadata defining an argument representation for the selected call data and a return representation for the return information.

20. A non-transitory computer-readable medium storing processor instructions that, when executed by one or more processors, at least one of the one or more processors being configured to support a trusted execution environment and to enforce an execution restriction that prevents at least one restricted instruction from being executed within the trusted execution environment, cause the one or more processors to perform operations comprising:maintaining, in memory in communication with the at least one processor:the trusted execution environment;common memory outside the trusted execution environment;a loaded enclave-aware executable operating at least partly within the trusted execution environment; anda loaded eABI-common executable operating within the common memory;identifying, from first eABI metadata associated with the loaded enclave-aware executable, an external symbol dependency corresponding to a restricted operation that is unavailable or disallowed within the trusted execution environment;identifying, from second eABI metadata associated with the loaded eABI-common executable, a published symbol and a defined entry point corresponding to processor instructions of the loaded eABI-common executable configured to perform the restricted operation within the common memory;resolving, according to symbol resolution semantics of an enclave-aware application binary interface (eABI), the external symbol dependency to the published symbol based at least on matching function signature information associated with the external symbol dependency and the published symbol;selecting, according to data transfer semantics of the eABI and based at least on the function signature information, selected call data for an invocation of the external symbol dependency by processor instructions of the loaded enclave-aware executable executing within the trusted execution environment, the selected call data comprising a representation of protected data maintained within the trusted execution environment and corresponding to one or more arguments of the invocation;making the selected call data available outside the trusted execution environment to the loaded eABI-common executable;causing the loaded eABI-common executable to process a restricted-operation request according to controlled entry point semantics of the eABI by transferring control only to the defined entry point corresponding to the published symbol and preventing the restricted-operation request from causing control transfer to an arbitrary address within the loaded eABI-common executable;causing the loaded eABI-common executable to perform the restricted operation within the common memory using the selected call data and using a restricted instruction, a system call, a standard library service, or an operating system interface, without directly accessing protected data maintained within the trusted execution environment that is neither included in nor represented by the selected call data; andcausing return information including result information to be formed according to return semantics of the eABI and applied to the invocation by the loaded enclave-aware executable.