Password enforcement capabilities for isolation
By inserting encryption and decryption instructions into the computer program and using protection domain management permissions, the problem of difficult control of memory area access permissions in a multi-process environment is solved, and the security and integrity of the memory area are achieved.
Patent Information
- Application Number
- CN201810996839.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-09-29
- Filing Date
- 2018-08-29
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2038-08-29
AI Technical Summary
It is difficult for existing technologies to effectively protect the memory area of a computing device from unauthorized access by malicious code, especially in a multi-process environment, making it difficult to effectively control and manage memory access rights.
The compiler inserts encryption and decryption instructions into the computer program to generate encrypted memory pointers, and uses the protection domain (PD) in the runtime environment for permission management to ensure that only authorized processes can access the shared memory area.
It implements strict permission control on the memory area, prevents unauthorized access by malicious code, ensures the security and integrity of memory access, and reduces the damage caused by malicious code to computing devices.
Smart Images

Figure CN109583152B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computing, and more particularly, to apparatus, methods, and storage media associated with encryption and decryption pointers (including associated metadata) for directing and restricting memory access of computer programs. Background Art
[0002] When a software application runs on a computing device, a processor executes machine-level instructions into which the application's high-level source code has been translated (e.g., by a compiler). The predefined set of machine-level instructions that a particular processor can execute is the processor's instruction set. The processor typically retrieves the machine-level instructions corresponding to the functionality of the software application from memory and then executes the instructions.
[0003] During the execution of the software application, the operating system may allocate memory to the executed process using a memory allocation mechanism. The memory allocation mechanism allocates an amount of memory (e.g., a block of memory locations, where the size of the block of memory locations is specified as an argument), and returns a pointer to the beginning of the allocated memory (e.g., a pointer to the beginning of the block of allocated memory locations). In some contexts, multiple processes may be executed simultaneously on a processor of a computing device, and each process may have access to a shared memory area of the processor. Malicious code may be inserted into high-level source code and machines, and possibly other program representation codes, by an adversary or an attack on a computing device. Malicious code may attempt to access a memory area (either specific to a single process or shared by multiple processes) that the original source code of the process has not attempted to access or has not had access to. Alternatively, the original source code may be partially or entirely created by an adversary who attempts to damage the security of other services running on the same platform (running malicious code by attempting to perform unauthorized memory access). BRIEF DESCRIPTION OF THE DRAWINGS
[0004] The embodiments will be readily understood by the following detailed description in conjunction with the accompanying drawings. To facilitate this description, reference numerals refer to similar structural elements. The embodiments are illustrated in the figures of the accompanying drawings by way of example and not by way of limitation.
[0005] Figure 1A An example compiler architecture for compiling source code and outputting executable code including inserted encryption and decryption instructions in accordance with various embodiments is shown.
[0006] Figure 1B An overview of the operational flow of a process for loading source code for a computer program, identifying where the source code generates or dereferences pointers, and generating executable code including encryption and decryption instructions in accordance with various embodiments is shown.
[0007] Figure 2 An example memory layout for hosting multiple services in a runtime environment is shown in accordance with various embodiments.
[0008] Figure 3 Encrypted pointers are shown in accordance with various embodiments.
[0009] Figure 4 According to various embodiments, Figure 3 The encrypted pointer is shown converted to a normal pointer and the normal pointer is passed to a standard instruction.
[0010] Figure 5 An overview of the operational flow of a process for executing decryption instructions according to various embodiments is shown.
[0011] Figure 6 An overview of the operational flow of a runtime process for handling memory access requests according to various embodiments is shown.
[0012] Figure 7 Optimization achieved by loading pre-cached epoch keys and generating new keys according to various embodiments is shown.
[0013] Figure 8 An example memory layout including a shared heap and two example protection domains is shown in accordance with various embodiments.
[0014] Fig.9A According to various embodiments, the Figure 8 Example pointers generated by functions in the example protection domain.
[0015] Fig. 9B According to various embodiments, the Figure 8 Additional sample pointers generated by functions in the sample protection domain of .
[0016] Fig.10 Maintaining integrity between protection domains by adding a bounds check after each ENDBRANCH (indirect branch valid position marker) instruction is shown in accordance with various embodiments.
[0017] Fig.11 A block diagram of a computer device having a data flow machine (hardware accelerator) suitable for practicing the present disclosure is shown in accordance with various embodiments.
[0018] Fig.12 It shows a method according to various embodiments configured to practice Figure 1A , Figure 1B , Figure 4 , Figure 5 and Figure 6 An example computer-readable storage medium containing instructions for aspects of the process. DETAILED DESCRIPTION
[0019] In an embodiment, a device for computing may include one or more processors, a memory, and a compiler operated by the one or more processors to compile a computer program. The compiler may include: one or more analyzers for parsing and analyzing source code of the computer program that generates a pointer or dereferences a pointer; a code generator coupled to the one or more analyzers to generate executable instructions of the source code of the computer program, including inserting additional encryption or decryption executable instructions into the computer program based at least in part on the results of the analysis to authenticate memory access operations of the source code.
[0020] In an embodiment, different services loaded into the same process may be granted access to memory regions only as needed, rather than all code in a process being granted full access to all memory within the address space of the process.
[0021] Furthermore, in an embodiment, a method for authenticating access to a memory area shared by one or more applications running on a computing device may include: receiving a first request from a function running in a protection domain (PD) of a runtime environment to allocate an object in shared memory and generate a capability to access it, and assigning a key to the PD and using an identifier (PDID) of the PD and the key to generate an encrypted pointer to the memory location of the object. The method may also include: receiving a second request from a function running in the PD to use the capability, and decrypting the capability and passing an unencrypted pointer to the object to the function.
[0022] In the following description, reference is made to the accompanying drawings, which form a part of the specification, wherein like reference numerals refer to like parts throughout, and wherein embodiments that can be practiced are shown by way of illustration. It should be understood that other embodiments may be used and structural or logical changes may be made without departing from the scope of the present disclosure. Therefore, the following detailed description should not be taken as limiting, and the scope of the embodiments is limited only by the appended claims and their equivalents.
[0023] The operation of various methods can be described in turn as a plurality of discrete actions or operations in a manner that is most helpful for understanding the claimed subject matter. However, the order of description should not be interpreted as meaning that these operations are necessarily order-dependent. In particular, these operations may not be performed in the order presented. The described operations may be performed in an order different from the described embodiments. Various additional operations may be performed in additional embodiments and / or the described operations may be omitted, split or combined.
[0024] For purposes of this disclosure, the phrase "A and / or B" means (A), (B), or (A and B). For purposes of this disclosure, the phrase "A, B, and / or C" means (A), (B), (C), (A and B), (A and C), (B and C), or (A, B, and C).
[0025] The description may use the phrases "in one embodiment" or "in an embodiment," which may each refer to one or more of the same or different embodiments. Furthermore, the terms "comprising," "including," "having," etc. used with respect to embodiments of the present disclosure are synonymous.
[0026] In addition, it is noted that the embodiment can be described as a process depicted as a flow chart, a flow diagram, a data flow diagram, a structure diagram or a block diagram. Although the flow chart can describe the operation as a sequential process, many operations can be performed in parallel, concurrently or simultaneously. In addition, the order of operations can be rearranged. The process can terminate when its operation is completed, but it can also have additional steps not included in the figure. The process can correspond to a method, a function, a step, a subroutine, a subprogram, etc. When the process corresponds to a function, its termination can correspond to the function returning to the calling function and / or the main function. In addition, the process can be implemented by hardware, software, firmware, middleware, microcode, hardware description language or any combination thereof. When implemented in software, firmware, middleware or microcode, the program code or code segment that performs the necessary tasks can be stored in a machine or computer readable medium. The code segment can represent any combination of steps, functions, subprograms, programs, routines, subroutines, modules, program codes, software packages, classes or instructions, data structures, program statements, etc.
[0027] As used herein, including in the claims, the term "circuitry" may refer to, be a part of, or include, an application specific integrated circuit (ASIC), an electronic circuit, a processor (shared, dedicated, or group, including one or more "processing elements (PEs) of a dataflow machine), and / or a memory (shared, dedicated, or group) that executes one or more software or firmware programs, a programmable combinatorial logic circuit (e.g., a field programmable gate array (FPGA)), and / or other suitable hardware components that provide the described functionality. In some embodiments, a circuit may implement one or more software or firmware modules, or the functionality associated with a circuit may be implemented by one or more software or firmware modules.
[0028] As used below, including in the claims, the term "memory" may refer to one or more hardware devices for storing data, including random access memory (RAM), magnetic RAM, core memory, read-only memory (ROM), magnetic disk storage media, optical storage media, flash memory devices, and / or other machine-readable media for storing data. The term "computer-readable medium" may include, but is not limited to, memory, portable or fixed storage devices, optical storage devices, wireless channels, and other various media capable of storing, containing, or carrying instructions and / or data.
[0029] As used below, including in the claims, the term "protection domain" (PD) refers to a set of access privileges to protected resources. In the case of many processes coexisting, each process has different access permissions to multiple protected resources via some form of key, it may be convenient to combine a set of such keys to provide access to the resources it needs to a single process. Access control can then be manipulated independently of the processes involved. A protection domain can be a set of keys, or equivalently a set of resources to which a key gives access rights. Multiple protection domains can operate on a server or other computing device, and they can each have access rights to shared memory. In the case of multiple microservices (see below) operating on a single device, each microservice can operate in a separate protection domain. The computing device can assign each of one or more protection domain access rights to a dedicated memory area for its code stack and dedicated heap, and can also grant each protection domain access rights to a shared memory area subject to conditions or within a defined time interval.
[0030] As used below, including in the claims, the term "microservices" refers to an approach to application development in which a single application is developed as a set of small services, each of which runs in its own process and communicates with lightweight mechanisms, typically HTTP resource APIs. Services are built around business capabilities and are independently deployable.
[0031] Note that in software applications, program sources are transformed into a list of machine executable instructions for a specific processor, which are then loaded into a memory attached to the processor. Data and instructions are read from the memory into the processor core, where the instructions are executed and the results are then written back to the memory. In an embodiment, a compiler for compiling a computer program may be used to parse and analyze source instructions of the computer program, including generating pointers or identifying source code that dereferences pointers, and may also be used to generate and output executable code of the computer program, including inserting additional encryption or decryption executable instructions into the computer program based at least in part on the analysis results to authenticate and authorize memory access operations of the source code.
[0032] Note here that a compiler is a program that reads source code (in the form of a source language) and translates it into target code (in the form of a machine language). The compiler forms an intermediate code (in a machine-independent form) while formulating the target code. For example, a compiler for C translates high-level source code in the C programming language into target code in machine language that can be executed by a computer processor, for example, X86 instructions executed on the processor may be able to The machine instructions executed on the processor. In addition, the compiler for C generates intermediate code at the same time as the target code. Machine-independent and machine-dependent optimizations can be performed on the intermediate code.
[0033] It is also noted that complex data center workloads are increasingly structured as microservices, as the overall functionality of the workload is divided into several loosely coupled services that are typically isolated in different containers and communicate via message passing. This growth of processes and remote procedure calls (RPCs) introduces a large amount of overhead from multiple sources. In an embodiment, new instructions may be generated to reduce this overhead by combining multiple services into a single address space so that pointers to message data can be shared directly. However, even if services can share address spaces, such new instructions may keep individual microservices isolated by encrypting capabilities (tags) that each service must have in order to access shared resources such as message content in memory.
[0034] As mentioned, in an embodiment, the compiler can instrument the original source code to insert new instructions. The new instructions can include encryption instructions after any source code instructions that generate pointers, and can also include decryption instructions that are inserted where the source code dereferences the pointer. Figure 1A and Figure 1B The compiler instrumentation process according to various embodiments is shown.
[0035] refer to Figure 1A, starting from the compiler block 101, there may be a scanner, or lexical analyzer, which may convert the character stream of the source program 102 into a token stream, and remove spaces, remove comments, expand macros, etc. The resulting token stream may be passed to a parser, or a syntax analyzer 103, which may convert a sequence of tokens into, for example, an abstract syntax tree. The abstract syntax tree generated by the syntax analyzer 103 may be passed to a semantic analyzer 105, which may check legal rules, and in doing so, may also bundle pieces of the syntax tree (by resolving identifier references, inserting cast operations to perform implicit coercion, etc.) to form a semantic graph. In an embodiment, the semantic analyzer 105 may identify nested loops and data dependencies of the source program 102, and include the information in the semantic graph.
[0036] Continue to refer Figure 1A , the semantic graph generated by the semantic analyzer 105 can be passed to the intermediate code and predicate calculation code generator 110. The intermediate code and predicate calculation code generator 110 can generate the intermediate code (pre-optimization) of the source program 102 according to the semantic graph. In an embodiment, the intermediate code and predicate calculation code generator 110 can also generate a code for encrypting the pointer after the pointer is generated and a code for decrypting the pointer when the pointer is dereferenced. The intermediate code (including the code for encrypting and decrypting the pointer) can be passed to the code improver 113 of the irrelevant machine. The code improver 113 of the irrelevant machine can optimize the intermediate code in various ways and pass the optimized code to the target code generator 115.
[0037] The target code generator 115 may string together basic blocks into straight-line code with fall-through, and pass the assembly language code to the final stage, the machine-dependent code improver 117, which may perform additional optimization and cleanup, and produce the executable code 112. Figure 1A As shown at 112 in the figure, compiler 100A outputs executable code including encryption instructions and decryption instructions to authenticate pointer generation and pointer dereference in source code. In some embodiments, these encryption and decryption instructions can be "ENCCAP" (encryption capability), "DECDCAP" (decryption data capability) and "DECCCAP" (decryption code capability) instructions, as described in detail below. Alternatively, they can be other instructions with similar or equivalent functions. In an embodiment, encryption and decryption instructions can provide a mechanism for a part of a computer program to send authorization to another part of the program to access a certain part of the memory.
[0038] In addition to incorporating these teachings, compiler 100A can be any compiler known in the art, capable of compiling source code in a high-level language (e.g., C, C++, Fortran, etc.) and outputting machine executable code. Although for ease of understanding, compiler 100A is described as having seven stages. In alternative embodiments, some stages can be combined or split. Similarly, in alternative embodiments, pointer generation and identification of pointer dereference and generation of code to encrypt pointers and decrypt encrypted pointers can be implemented in other stages or supplementary functions of the compiler except semantic analyzer 105 and / or intermediate code and predicate calculation code generator 110.
[0039] Figure 1B A compiler (e.g., having a compiler) operating on source code and generating corresponding object code including executable code for encrypting generated pointers and decrypting dereferenced pointers according to various embodiments is shown. Figure 1A An overview of the operational flow of a process of a compiler for the depicted architecture) is provided. As shown, process 100B may include operations performed at blocks 140-170. Figure 1B , process 100B may begin at block 140. At block 140, the compiler may load source instructions of a computer program for analysis, such as Figure 1A From block 140, process 100B may proceed to block 150, where the compiler may identify where the source code generates a pointer to one or more memory addresses. From block 150, process flow may proceed to block 160, where the compiler may generate and output executable computer code that, when executed, encrypts the pointer and inserts the identified instructions into the source code. From block 160, process 100B may proceed to block 170, where the compiler may identify where the source code dereferences the pointer to one or more memory addresses. From block 170, process flow may proceed to block 180, where the compiler may generate and output executable computer code that, when executed, decrypts the encrypted pointer (before dereferencing it in memory). From block 180, process flow may return to block 150, if there is more source code to be analyzed, and repeat processing at blocks 150 to 180, or if there is no additional source code to be analyzed, process 100B may terminate.
[0040] In an embodiment, instead of all code in a given process being granted full access to all memory within the address space of the process, different services loaded into the same process may be granted access only to memory regions as needed. Figure 2One possible memory layout for hosting multiple microservices in a runtime environment hosted as a virtual machine is depicted in FIG. With reference thereto, there is a root PD 210 having its own (code) stack 211 and a dedicated heap 213. Similarly, there is also a PD#1 220 associated with a first service and a PD#2 230 associated with a second service operating in the runtime environment. Continue to refer to Figure 2 , each service associated with PD#1 220 and PD#2 230 has a stack and a private heap like PD 210. In addition, each service can be granted the ability to access necessary objects in the shared heap 240 by the root PD 210, and each service can also generate capabilities (e.g., pointers) that grant it access to objects in its own stack and private heap. In an embodiment, these capabilities can be encrypted by a key managed by the root PD 210 to prevent unauthorized capabilities from being generated by these services, such as one service attempting to access an object handled by another service.
[0041] Continue to refer Figure 2 , there is a shared heap 240 that can be used by services 220 and 230 to access objects, operate on objects, and store modified objects back to shared memory on a conditional and restricted basis. That is, in an embodiment, all services not associated with the root PD 210 can only access the shared heap 240 if the pointer (also referred to herein as a "capability" when encrypted and with metadata added) used by the service to access the shared heap 240 is successfully decrypted. Therefore, a service running in PD#1 220 can generate an encrypted pointer 223 or capability to an object in the shared heap 240 based on the execution of the encrypted instructions inserted into its executable code as described above. Also as described above, access to the object may or may not be granted, depending on whether the encrypted pointer 223 is successfully decrypted via the decryption instructions inserted into its executable code. The same conditional access applies to the encrypted pointer 233, which can be generated by a service running in PD#2 230. Therefore, the encrypted pointers 223 and 233 utilize Figure 2 . If the encrypted pointer has been compromised, or improperly manipulated, as described below, when a service using it attempts to dereference it (using the encrypted pointer), it will not be successfully decrypted, and access to the object in the shared heap 240 will be denied. In this way, various services operating in the runtime environment can pass objects to each other in a controlled manner, and thus preserve any hierarchical structure that the object may include.
[0042] In order to implement the encryption protection according to various embodiments, it is necessary to properly insert the original source code, as described above in conjunction with Figure 1A and Figure 1BFor this purpose, there is a runtime loader 250, which can scan all the code to ensure that the encryption and decryption instructions are actually inserted by the compiler before executing any code in the PD's stack, such as Figure 1B This scan is shown in Figure 2 This is shown in FIG. 1 by arrows 251, 252 provided between the runtime loader / manager 250 and the respective stacks of PD#1 220 and PD#2 230. In an embodiment, the runtime loader / manager 250 may refuse to load the code if it fails this test.
[0043] Note that traditionally individual microservices can be hosted in separate virtual machines (VMs) or containers. However, this introduces a lot of overhead due to context switching, page table maintenance, translation lookaside buffer (TLB) flushing, network stack overhead for message passing, etc. In contrast, services with capability isolation do not encounter these overheads. Although there are some overheads from using capabilities, such as the cost of encrypting and decrypting them, this is significantly lower than the conventional separate VM model. It is also common that if separate VMs are used, objects cannot be passed between services without destroying the hierarchical structure of the objects.
[0044] In an embodiment, each microservice in the runtime environment of the processor may be assigned a protection domain ID (PDID). For example, the PDID may have 32 bits. In an embodiment, the PDID may be used as the immediate value of various immediate operands embedded in the microservice code. Moreover, all microservices loaded into a single instance of the runtime environment at the same time must have different PDIDs. Note that if the PDID is randomly assigned, the 32-bit PDID space can minimize the possibility of PDID conflicts, but conflicts may still occur. Conflicts may also occur if a single microservice is loaded multiple times. In order to handle PDID conflicts, in an embodiment, the microservice code may be copied so that the embedded PDID can be reassigned to a different PDID. Alternatively, additional information may be mixed into the PDID. For example, in an x86-64 processor, bits 47:32 of the current instruction pointer (IP) may be automatically used to replace the higher 16 bits or lower 16 bits of the embedded PDID. In an embodiment, by allocating 4GiB of linear address space to each protection domain (PD) and selecting a 4GiB aligned memory layout that avoids conflicts between the final calculated PDIDs, conflicts can be avoided without the need to copy any code pages. Also note that 47:32 of the current RIP can be used independently to specify the PDID without an immediate operand. Other alignment sizes can be used equally, with corresponding slices of address bits used to determine all or part of the PDID: IP [highest significant available address bit index: log2 (PD alignment size)].
[0045] As mentioned above, in embodiments, the compiler is responsible for instrumenting the source code with encryption and decryption instructions according to various embodiments. As previously mentioned, "inserting code" as used herein refers to modifying the source code, intermediate representation, or machine code so that it contains new instructions where appropriate. In embodiments, several new instructions that can be added to the instruction set are described. In embodiments, these instructions can be implemented in conjunction with Figure 1B The encryption and decryption instructions mentioned above create Figure 2 For ease of explanation, the format is suitable for The company's instruction set architecture and is described as such. However, it is noted that, according to various embodiments, the functionality of these new instructions can be implemented in any instruction set. These new instructions are referred to herein as "ENCCAP" (encryption of capabilities), "DECDCAP" (decryption of data capabilities) and "DECCCAP" (decryption of code capabilities). In addition, the new instruction "NARROWCAP" (reducing the memory boundaries of existing capabilities) for reducing capabilities, as well as the new instruction for generating a key for the initial epoch "INCEPOCH" are also described below in conjunction with alternative embodiments. It should be understood that no matter where these specific instructions are described below, equivalent or similar instructions that provide their functionality will be included. As executable instructions, ENCCAP, DECDCAP and DECCCAP, NARROWCAP and INCEPOCH, although the result of compiler instrumentation, each is executed at runtime.
[0046] Thus, in an embodiment, the ENCCAP instruction may be used when a portion of a program wants to grant some other portion of the program access to a memory. For example, if the heap allocator wants to grant access to a new heap allocation to a portion of the program that requested the heap allocation. Or, for example, if a portion of the program wants to grant access to an array of integers to a function that sorts an array of integers. Similarly, the DECDCAP instruction may be used in a receiving portion of a program to convert an incoming tag into a standard pointer that can be used by a memory access instruction. Thus, ENCCAP and DECDCAP encrypt and decrypt pointers.
[0047] Reference now Figure 3, shows an example encrypted pointer 300 according to various embodiments. Because in an embodiment, the encrypted pointers grant access to memory areas, they are used interchangeably herein with the term "capabilities". As shown, capabilities may also contain metadata, as shown in fields 305 (indicating permanent or transient) and 310 (indicating the size of the pointed object). Capabilities grant access to memory blocks or branch destinations in a particular protection domain using keys controlled by the root PD (defined as the PD with PDID 0). In an embodiment, the keys may be accessed via instructions for accessing processor internal registers. For example, via RD / WRPKR instructions in the root PD to a pair of user mode control registers, or via RD / WRMSR instructions in the root PD to a pair of model-specific registers, or via instructions to access some other storage mechanism.
[0048] Continue to refer Figure 3 , in an embodiment, a capability may include three fields. A "permanent" field 305, an object size field 310, and a pointer field 315. The "permanent" field 305 may include a single bit that may select between one of two cryptographic keys: one for capabilities that never expire, and another for capabilities that are valid only for a defined period of time (called an epoch), as described in more detail below. The object size field 310 may include 6 bits that specify the log2 of the size of the object to which the capability grants access. Thus, up to 2 63 An object of bytes may be specified by this field. Finally, the pointer field 315 contains the memory address. In an embodiment, the address may comprise 57 bits, so that the entire capability comprises 64 bits and is therefore equal in size to a conventional pointer on a 64-bit computing machine, which is beneficial in reducing required compiler, library and application changes and for saving pointer storage space.
[0049] In an embodiment, only a portion of the pointer address may be encrypted leaving some unencrypted lower address bits free to be modified. Figure 3 In the example of , only the upper 32 bits are encrypted, as shown by encrypted bits
[32] 320. In an embodiment, these bits may be encrypted using a password 321. Note that a password is an algorithm used to perform encryption or decryption. In alternative embodiments, passwords with different block sizes may be used, and therefore, encrypted bits 320 may have different values. Capability 200 thus grants a process or microservice access to a memory region that is aligned to a power of 2 of a certain size as specified in object size field 310. In an embodiment, the value of object size field 310 may also be used to determine the number of unencrypted bits 330 that are subject to the constraint. As Figure 3As shown, the number of constrained lower address bits is given by [25:log2(obj.size)], which is 25 less than the value of the object size field 310. The object size field 310 thus has the direct effect of controlling how many unencrypted lower address bits are incorporated into the tweak information (used in the encryption / decryption of the pointer). In an embodiment, the tweak information may be obtained by combining the above with Figure 1B The encryption and decryption instructions described are dynamically generated and fed to the encryption and decryption algorithms as part of the key input.
[0050] In an embodiment, the adjustment information may affect the ciphertext of the encrypted address bits of the pointer field 315. Thus, if any of the adjustment information bits are modified, different plaintext for the higher address bits will result when a program attempts to use capability 200. As described above, a capability may be a data capability or a code capability. In an embodiment, a code capability that specifies an authorized entry point into a protection domain (e.g., into a function residing in a dedicated memory area assigned to a given PD) may be defined as having a size of 1, and therefore may have an object size field 310 of 0.
[0051] In an embodiment, the adjustment information may include:
[0052] PDID is authorized to use capabilities (32 bits);
[0053] Zero-fill, right-align the lower address bits of the constraint (25 bits);
[0054] size[4:0] (5 bits), and additional size bits size[5]; and
[0055] Reserved (1 bit).
[0056] Note that in the event of a capability leak to another PD, the PDID for the PD that generated the capability is included in the adjustment information. In addition, the additional size bit size[5] is only relevant for determining whether indirect access to the capability is required at runtime. In an embodiment, the highest value of the size field that can be directly processed by a decryption instruction (e.g., a DECDCAP instruction) without root PD intervention can be set to 25, which is represented as 011001 in binary. Therefore, if size[5] is set, the object must be so large that the root PD must intervene to check the attempted access to it. However, in an embodiment, there may also be object sizes that do not set size[5] that must be processed with root PD intervention (if their sizes are simply stored in the size field). Therefore, for simplicity, in some embodiments, it may be desirable to set the size field to 100000 for all sizes greater than 25, and if size[5] is set, cause DECDCAP to transfer control to a handler in the root PD. Alternatively, in other embodiments, the size may be stored in the size field, and if the value of the size is greater than 25, a decryption instruction such as DECDCAP may call a handler in the root PD.
[0057] In an embodiment, the encrypted bits 320 may be encrypted using any cipher 321 that supports a small block size (e.g., 32 bits) and accepts 64 bits of justification information. In an alternative embodiment, the 32-bit PDID may be omitted, and thus such an alternative embodiment may use only 32 bits of justification information.
[0058] It is noted here that an advantage of the encryption and decryption disclosed herein is that it is largely compatible with conventional non-capable machines, and that the capable machine semantics can be implemented entirely by a small set of new instructions as described below. In an embodiment, when capabilities are used, they are first transformed into ordinary pointers by the new instructions, and then those ordinary pointers are passed to ordinary instructions in the base instruction set architecture (ISA) (e.g., IA-32). The process is shown in Figure 4 middle, Figure 4 Depicted is the process of decrypting each of the data capabilities and code capabilities by the runtime environment 401 using, for example, the new / special instructions DECDCAP and DECCCAP in accordance with various embodiments.
[0059] refer to Figure 4 , showing data capability 410 and code capability 450. In an embodiment, these capabilities may have Figure 3 The pointer is in the form of 300. Figure 4 Starting at the top line of , data capability 410 may be entered into a DECDCAP instruction 415 along with the PDID of the PD seeking access to the base pointer. Figure 4 As shown, the instruction also takes the PDID as an immediate input. However, this is optional, and in alternative embodiments, the decryption instruction may not take the PDID as an input. In an embodiment, the output of the execution of the data object decryption instruction 415 (e.g., DECDCAP) is a standard undecrypted data pointer 420, which can then be passed to a load or store instruction 425 in the normal route. Similarly, reference Figure 4 , code capability 450, along with the PDID of the PD seeking to access the base pointer (optionally), may be input to a code capability decryption instruction 455, e.g., DECCCAP. As above, the instruction may optionally take the PDID as an immediate input. In an embodiment, the output of execution of the code capability decryption instruction 455 may be a standard, undecrypted code pointer 460, which may then be passed to a branch instruction 465 in the normal route. Figure 4 The adjustment information is shown as an input for both data capabilities 410 and code capabilities 450. Note that in an embodiment, the adjustment information is actually calculated by DECDCAP and DECCCAP from their respective inputs, and need not be provided as a separate input.
[0060] In an embodiment, a capability may be created by a new or dedicated instruction, such as an "ENCCAP" ("Encryption Capability") instruction. The ENCCAP instruction may have the following syntax:
[0061] ENCCAP r64, r / m64, imm32,
[0062] Where the immediate operand (imm32) specifies the PDID of the PD for which the capability is sought, r / m64 is the source operand, and r64 is the destination operand specifying where the output capability should be stored. If the immediate value is zero, then in an embodiment, a register (e.g., EAX) may be implicitly used as a source operand whose contents specify the PDID. In an embodiment, a code capability may be created if a register is used as a source operand.
[0063] Otherwise, if the source operand specifies a memory operand, the truncated contents of the base register (or zero if no base register is specified) may be used as the address portion of the capability (e.g., Figure 2215 in the destination register), and the offset (scale * index + displacement) can be used as the object size. As described above, if the object size is 1, a code capability is created. Alternatively, the ENCCAP instruction can be defined so that if the base register is not used, a code capability is created using a truncated effective address as the address portion of the capability. The final contents of the destination register are the encrypted capability. If an indicator is provided to the instruction, such as setting the zero flag or using the REP instruction prefix, a permanent capability is created. Otherwise, the capability can be encrypted using the current per-epoch key.
[0064] In an embodiment, a general protection fault may be generated if the specified capability cannot be represented (e.g., the object size is not a power of 2), or if the process is not running in a root PD and the pointer and object size provided would grant access to memory outside the bounds of the current PD. Alternatively, the ENCCAP instruction may set the size[5] bit in such a case and leave the capability unencrypted to indicate that access using the resulting capability must be mediated by a runtime-provided authorization routine, as described below, for mediating access to objects that are too large to be represented using an encrypted capability.
[0065] In an embodiment, a runtime loader such as Figure 2 The runtime loader / manager 250 in can scan all code to ensure that all uses of ENCCAP in the code only involve stack and global allocations and functions for the PD containing this instance of ENCCAP. However, in an embodiment, the use of the root PD of ENCCAP is not restricted.
[0066] Note that shared objects larger than 32 megabytes (MiB) cannot be represented directly with a single capacity, but 32MiB slices of the object can each be represented. (This is because the encrypted slice of pointer bits is placed in the middle of the pointer. If one were to attempt to represent a 64MiB object and then also attempt to increment the resulting capacity by 32MiB or more, the least significant bit of the encrypted slice would flip. This would result in corrupted plaintext when the slice is subsequently decrypted. Similar reasoning applies to all object sizes larger than 32MiB.)
[0067] Otherwise, in an embodiment, the root PD that generates the capability for objects in the shared heap may be called to mediate access to larger objects. For example, in an embodiment, the root PD may implement a function that may be called by other PDs to request approval to access a specific address range within a large object. In such an embodiment, the runtime loader may be required to scan the code at code load time to ensure that all accesses to large objects are properly requested to the root PD for approval. Note that in an embodiment, the authorization routine may also be used to mediate access to memory areas containing objects that are not necessarily aligned on power-of-two boundaries and therefore cannot be directly regulated using the DECDCAP instruction (as shown by the size field 310 of the power-of-two object boundary). In an embodiment, if the ENCCAP instruction is used to generate the capability for the larger or unaligned object, it can set the size[5] bit to indicate that the capability is not encrypted. Alternatively, because the capability is not encrypted, in an embodiment, the software can generate it directly without using the ENCCAP (or equivalent) instruction.
[0068] In an embodiment, the specification of DECDCAP (data capability decryption instruction) may be as follows:
[0069] DECDCAP r64,m64,imm32,
[0070] Where, as in the case of the ENCCAP instruction described above, the immediate operand (imm32) specifies the PDID of the PD for which the capability is sought, m64 is the source operand, and r64 is the output capability, now a decrypted standard pointer. In an embodiment, if the source operand m64 specifies a data size that is less than 2, a general protection fault may be generated. In an embodiment, as described above with reference to Figure 3 As mentioned, execution of DECDCAP results in decrypting the capability from the base register and placing it into the destination operand, and also comparing the constrained address bits of the effective address with those in the base register. In an embodiment, if the two are different, a general protection fault or a BOUND out-of-range fault occurs.
[0071] As mentioned above Figure 3 As described, execution of DECCCAP results in decryption of the capabilities in the source operand and placing the decrypted code pointer in the destination operand. In an embodiment, if the capabilities in the source operand specify a data size other than 1, a general protection fault may be generated.
[0072] In an embodiment, the software runtime environment may scan the code of each PD as the code loads to ensure that the appropriate DECDCAP or DECCCAP instruction is executed before any use of the pointer, depending on whether the code following the instruction uses the pointer for data access or branching.
[0073] As an example, the following pseudo-code illustrates how the DECDCAP instruction may be used in an embodiment (on entry, the encoded pointer is stored in RAX):
[0074] …
[0075] DECDCAP 69,7(%RAX),%RCX; Decrypts a pointer from RAX and loads into RCX, specifies PDID 69, and specifies an access size of 8.7 to enable calculation of the highest accessible address.
[0076] MOV(%RCX),%RDX; load from object
[0077] …
[0078] To summarize the above, Figure 5 An overview of the operational flow of a process for executing a DECDCAP decryption instruction by a processor executing a program or application within a runtime environment according to various embodiments is described. Figure 5 , process 500 may begin at block 505. At block 505, the DECDCAP instruction with the encrypted capability and PDID as input may be decrypted by the processor for execution. From block 505, process 500 may proceed to query block 510, where the processor may determine whether the size of the capability is less than 2. In an embodiment, this may be accomplished by reading the Figure 3 The object size field 310 of the capability shown is completed. If the answer is yes at query box 510, the encrypted capability is not a data capability, and process 500 can declare a general protection fault at 513, and process 500 can then terminate. However, it is noted here that in alternative embodiments, code capabilities are not supported by the processor (i.e., if encrypted pointers are only used to represent data object boundaries), single-byte data capabilities can be supported and query box 510 (and box 513) can be eliminated).
[0079] However, if the result at query box 510 is No, the capability is a verified data capability, and process 500 can proceed to query box 515, where process 500 can check whether the value of the size field is greater than 25. If it is Yes at query box 515, the object is too large to be directly processed by DECDCAP, and the root PD must intervene to check whether the access is allowable by consulting its internal data structure in software. In such a case, process 500 can transfer control to a handler in the root PD whose entry point instruction address can be specified in an internal CPU register, after which, at 517, process 500 can terminate.
[0080] If it is no at query box 515, process 500 can proceed to box 520, where the runtime environment can process the effective address as a capability as a check and verify that all of its bits except its unconstrained address bits are the same as those in the base register. It is noted here that the effective address represents the highest address to be accessed within the object, and therefore the comparison is used as a boundary check. If the constrained address bits are different, it is likely that the wrong, malicious or damaged code adds an excessive value to the capability or subtracts an excessive value from the capability, so that the attempted access based on the modified capability is no longer within the boundaries of the object it refers to (in the case where the runtime environment can decrypt the capability and place the resulting pointer into the specified destination operand). From box 520, process 500 can proceed to query box 530, where it can be determined whether both capabilities have the same higher bits that are higher than the object size specified in the capability. If it is yes at 530, process 500 can proceed to box 540, where the execution of the instruction is completed, and process 500 can end. However, if the result at query block 530 is no, process 500 may proceed to block 545 where the runtime environment may generate a general protection or "BOUND out of range" error and process 500 may terminate.
[0081] In conjunction with the bounds testing of query block 530 of process 500, note that even if the bounds testing within DECDCAP fails to detect certain corrupted or out-of-bounds data pointers, they may decrypt to point to unmapped memory locations in the larger address space, which will result in a detectable page fault. In an embodiment, the software runtime may respond to the page fault by terminating the process that caused the fault. Similarly, a corrupted code pointer may result in a branch to an unmapped memory location, also resulting in a page fault. In an embodiment, if features such as With the company's Control Flow Enforcement Technology (CET), even stronger assurance is possible because it is highly unlikely that a corrupted code pointer will be located on an ENDBRANCH instruction.
[0082] As described above, additional metadata such as memory access permissions and protection key IDs may be stored in the capability, and information about the attempted access (e.g., whether a read or write is being attempted) may be specified to the DECDCAP instruction so that the DECDCAP instruction can check whether the attempted access is permitted based on the metadata in the capability and generate an error if it is not permitted.
[0083] In an embodiment, software runtimes and applications may run within a trusted execution environment (TEE), e.g. SGX to protect software runtimes and applications against various types of attacks that reside within the confines of the TEE while in use.
[0084] As described above, in an embodiment, a separate key may be assigned to each permanent capability and each epoch capability by the runtime environment. In an embodiment, one or more sequences of epochs may be defined for each logical processor. In an embodiment, each processor may maintain a separate per-epoch key to avoid overhead synchronization in the case where each processor is capable of running an independent PD. However, if a PD needs to run on multiple processors, all processors running the PD must use the same per-epoch key.
[0085] Note that by defining epochs according to various embodiments, one of the most significant drawbacks of the classic capability machine, such as those using fat pointers and tagged memory, can be overcome. The drawback is capability revocation, the problem of removing capabilities after they have been granted. Unlike systems with a centrally controlled memory authorization structure such as a page table, the capability machine scatters authorization tags (capabilities) in memory, with no easy way to keep track of them at all times. The use of epochs causes capabilities to automatically expire after their epoch ends, regardless of where they are stored. This is very suitable for microservices, which typically operate in a reactive event-driven manner. In an embodiment, a new session can be generated whenever a new event arrives, so that the current epoch is associated with the current session.
[0086] To summarize the above explanation, here is an explanation of the integer array example above. Assume that the original source code of the example program includes an array sorting function represented by the following pseudocode:
[0087] Pseudocode of program part A:
[0088] {
[0089] int nums[5]={34,15,64,7,9};
[0090] sort(nums);
[0091] }
[0092] sort(int[5]array){
[0093] while(array is not sorted){
[0094] for(int i=0;i<4;i++){
[0095] if(array[i+1] <array[i]){
[0096] swap(array+i,array+i+1);
[0097] }
[0098] }
[0099] }
[0100] }
[0101] In an embodiment, array capabilities may be generated, sent, and used as described below. The integer array pointer shown above in program portion A may be encrypted, for example, using ENCCAP, which may output the encrypted capabilities of accessing the array. The capabilities may be provided to the call stack of the executor, which then calls the sorting function provided above. Because the pointer to the array is now encrypted, the DECDCAP instruction may be used to decrypt the encrypted pointer to the integer number of objects. Once DECDCAP is executed, an unencrypted pointer, an integer array pointer, is generated, and the code may use the unencrypted pointer to sort the array object.
[0102] Therefore, in an embodiment, the original source code may be transformed into the actual source code by a compiler based on the following pseudo code:
[0103] Pseudo code of program part A used for instrumentation:
[0104] {
[0105] int nums[5]={34,15,64,7,9} aligned to the least power-of-2that isadequate for storing nums;
[0106] nums_capability=ENCCAP(nums,sizeof(nums));
[0107] sort(nums_capability);
[0108] }
[0109] sort(int[5]capability array){
[0110] while(array is not sorted){
[0111] for(int i=0;i<4;i++){
[0112] array_i_ptr=DECDCAP(array+i,sizeof(int));
[0113] array_i_plus_1_ptr=DECDCAP(array+i+1,sizeof(int));
[0114] if(*array_i_plus_1_ptr<*array_i_ptr){
[0115] swap(array+i,array+i+1);
[0116] }
[0117] }
[0118] }
[0119] }
[0120] Therefore, in an embodiment, the two-stage encryption / decryption scheme embodied in, for example, ENCCAP and DECDCAP instructions represents a mechanism by which a part of a computer program sends authorization to another part of the program to access a certain segment of memory. Note that without such a scheme, it would be necessary to create some other mechanism to explicitly transmit the authorization between different parts of the program, or to derive in some way whether each memory access is authorized. In order to understand the challenging reasons for doing so, it is noted here that each program statement that accesses memory through a pointer may need to use a plurality of different pointers. For example, the sorting function in the above example is general, and therefore it can be called from many different parts of a given program to sort many different arrays.
[0121] Figure 6 An overview of the operational flow of a runtime process for handling memory access requests and associated capabilities according to various embodiments is shown. Figure 6 , process 600 may begin at block 610. At block 610, a runtime environment (e.g., Figure 1A-1B A runtime environment of a compiler of a given PD) may receive a request for an object in a shared memory of a computer system and generate a capability to access it from a function of an application in a given PD managed by the runtime environment. From block 610, process 600 may proceed to block 620, where the runtime environment may dispatch a key to the PD and generate an encrypted pointer to the memory location of the object specified in the request. It is noted here that in an embodiment, the key may be dispatched to an epoch that is active while the PD is running. In an embodiment, the key may be dispatched at the beginning of the epoch.
[0122] The encrypted pointer may be generated by inserting encryption instructions (eg, ENCCAP) as described above, and may be encrypted using, among other things, the PDID and key of the requesting PD, as described above. As described above, the key may be persistent or may expire at the end of an epoch.
[0123] From block 620, where the encrypted pointer is generated, process 600 may fork into two branches, one in which a function in the PD requests to use a capability and the other in which a function in the PD seeks to transfer a capability. Thus, in the first branch, process 600 may proceed from block 620 to block 630, where the processor may receive a request from a function in the PD to use the capability. For example, prior to making the request, the function may have changed the pointer address of the capability in a legal manner, such as by changing a bit of a pointer field of an unconstrained capability, or, for example, in an illegal manner, such as by changing a constrained bit.
[0124] From block 630, process 600 may proceed to block 635, where the capability may be decrypted and converted to an unencrypted pointer and passed to a standard instruction. At block 650, process 600 may end.
[0125] Alternatively, proceeding along the second branch, process 600 may proceed to block 640, where a function in a PD indicates that it wishes to transfer the capability to another function in another PD (this is Fig.9A 7, as described below). Process 600 may then proceed from box 640 to box 645, where the runtime environment may decrypt the capability, encrypt the now unencrypted capability using the key for the receiving (transferee) PD if the receiving PD is currently running and awaiting the incoming capability, and pass the re-encrypted capability to the receiving PD. At box 645, process 600 may end. However, if the receiving PD is not yet running, or is not ready for the incoming capability, in an embodiment, the decrypted capability may be enqueued using information specifying the identity of the receiving PD. When the receiving PD is ready for the incoming capability, the decrypted capability may be encrypted using the key for the receiving PD and transferred to the receiving PD. For example, the receiving PD may receive the incoming capability as a parameter to its startup routine. Alternatively, the receiving PD may use a call to a runtime API to indicate that it is ready to receive an incoming capability at some point in its execution.
[0126] As described above, capabilities may be permanent, or may be valid only for an epoch. For capabilities that are valid only for an epoch, in an embodiment, in order to minimize the time required to replace the current epoch key with a new epoch key, the processor or CPU may begin generating a new epoch key once another epoch key is installed. For example, this may be accomplished by a new / dedicated "INCEPOCH" instruction that loads a pre-cached epoch key and begins generating new epoch keys. In an embodiment, the INCEPOCH instruction may be executed when one epoch has completed and another is about to begin. In an embodiment, INCEPOCH may be executed prior to executing the ENCCAP instruction (or equivalent) for each capability provided as input to the next epoch, such that those capabilities are encrypted using the appropriate key. This process is illustrated in the description below. Figure 7 .
[0127] refer to Figure 7 , a shared heap 710 is shown in which an object 715 is stored. The shared heap 710 is similar to the shared heap of FIG. 1 described above. As shown, two microservices, microservice A 730 and microservice B 740, each have access to the shared heap 710 and may each require access to the object 715. Microservice A 730 and microservice B 740 are similar to service PD#1 120 and service PD#2 130 of FIG. 1 described above. Therefore, microservice A 730 and microservice B 740 may each be assigned a separate PD by the runtime environment.
[0128] Upon receiving a first request, request A 720 issued from microservice A 730, the runtime environment may decrypt the request and issue a tag A 725, such as unencrypted capability, based on the decryption of request A 720 as described above. For example, the runtime environment may execute a DECDCAP instruction previously placed into the compiled code of the application running in microservice A 730, as described above. Tag A 725 may grant microservice A 730 access to object 715 for a single epoch, epoch A 721, as shown. At some later time, microservice A 730 may seek to transfer access to object 715 to microservice B 740. For example, object 715 may be an employee record, and after some processing of the record, microservice A 730 may pass it to microservice B 740 for further processing. In an embodiment, rather than always granting access to both microservices to an object in a shared heap, for greater security, each microservice's access to the object may be controlled using an encrypted pointer, as described above.
[0129] Continue to refer Figure 7, after microservice A 730 has completed its processing of object 715, it may request that the object be passed to microservice B 740, as mentioned. Thus, it may issue request B 735, in the form of an encrypted pointer or capability, to transfer access to object 715 to microservice B 740. This request may be decrypted by the runtime environment and transformed into tag B 745, which then now grants microservice B 740 (unique) access to the object. As in the case of microservice A, the access granted by tag B 745 may be time-limited, lasting only for the duration of epoch B 741. As shown, the process may continue, and an application running as part of microservice B 740 may seek to transfer access to object 715 back to microservice A, or to a third microservice via request C.
[0130] In an embodiment, to manage which capabilities are valid during a given epoch, each logical processor may be assigned metadata associated with each shared object. In an embodiment, a table of shared objects for each epoch may be maintained, and garbage collection metadata may be stored in the table. In an embodiment, if the whole or part of an object is referenced by any capability in the current epoch or a permanent capability on the logical processor, or, for example, if the object is queued until it is sent to some other PD in a scheduling queue for the logical processor, the metadata of the shared object may indicate that fact. In an embodiment, when the metadata for an object indicates that the object is no longer referenced by any transient or permanent capability or exists in any scheduling queue for any logical processor, the object may be released. In an embodiment, at the end of each epoch, the root PD may update the metadata of the logical processor in which it is running, clearing the metadata indicating that there are transient capabilities for objects used in the ending epoch. In addition, in an embodiment, when a message is transferred between scheduling queues, the metadata for the referenced object may be appropriately updated; that is, the metadata of the logical processor of the send queue indicating that the object is enqueued for the logical processor may be cleared, and the metadata indicating that the object is enqueued for the logical processor of the receive queue may be set.
[0131] Note here that for the case where certain capabilities are permanent for an object in shared memory, in order to transfer the object to another PD, an additional capability, either permanent or transient, may be generated to refer to the object currently referenced by the permanent capability.
[0132] Described below are the details of an exemplary software runtime environment that can be used according to various embodiments. As an example, a VM-based runtime can be developed to efficiently host microservices. However, it should be understood that similar implementations can be applied to other basic runtime environments.
[0133] In an embodiment, the runtime library in PD 0 can provide multiple services, including capability creation, garbage collection, scheduling and epoch maintenance, and message passing between PDs and over a network. In an embodiment, for convenience, some services can be implemented in a VM user space monitor, rather than as a guest VM. In such an implementation, some enhancements to existing functions can be provided. First, for example, the runtime dynamic loader in the VM user space monitor can be extended to install a new PD that is packaged as a relocatable ELF file into an existing guest VM after scanning and verifying basic credibility. Second, for example, an EPT violation handler or a page fault handler can monitor erroneous / malicious access attempts and terminate the PD when necessary. Third, for example, a VT-x preemptive timer handler can be used to terminate any PD that exceeds its time slice. It is noted here that a PD in a non-preemptive event-driven execution model can not be suspended and continued because it can maintain capabilities for objects that have expired in a shared heap and have been "garbage collected" when the PD continues.
[0134] Note, however, that preemption may also be supported by saving and then subsequently restoring the current epoch key and runtime state of the preempting service. As a result, in some embodiments, the root PD may not allow any other service to access a shared object for which the preemption epoch retains capability. (Note here, however, that other PDs may also have the ability to grant access to objects. In this case, those other PDs may continue to access the object even while the first PD is preempted.) This would require more information about each object to be stored in the tables that manage garbage collection. For example, each epoch may be assigned a monotonically increasing numeric ID, and the ID of the latest epoch in which the object is available may be stored in the garbage collection metadata table. This would allow the preemption epoch of each object to be assigned an extremely large epoch ID using transient capabilities so that the objects to which they point will not be garbage collected.
[0135] In the method, when a PD is granted access to an object, in an embodiment, the stored epoch ID in the garbage collection metadata table may be updated only if the epoch ID of the PD to which the new access is granted is greater than the current epoch ID in the garbage collection metadata table for the object. Alternatively, an indicator may be attached to the garbage collection metadata table entry for each object referenced by a transient capability in a prior epoch indicating the number of prior epochs that referenced the object. In an embodiment, a separate data structure may be attached to each prior epoch that utilizes a transient capability to indicate which objects it refers to. When the preemptive epoch eventually continues, the centralized garbage collection metadata for objects referenced by that epoch utilizing paused capabilities will be updated to reduce the indicator of the number of prior epochs that referenced the object and update the active metadata indicating that the current epoch references the object.
[0136] Fourth, for example, the system call and hypercall handlers can be enhanced to receive and check capabilities instead of pointers. The root PD can configure the OS kernel or VMM with capability encryption keys for the current PD to enable the capabilities to be checked and used through the system call and hypercall handlers. Alternatively, the OS can perform an upward call to the root PD to request the current capability encryption key. Alternatively, the OS can rely on the processor to have been configured with the appropriate capability encryption key to enable it to use encryption and decryption instructions (e.g., ENCCAP and DECDCAP instructions) to process capabilities.
[0137] In an embodiment, the root PD may provide an API to other services, such as send(dest.PDID, message capability from shared heap). The service may check that the message capability has not been enqueued to enforce exclusive ownership of the capability, and may queue the message to the queue of the current logical processor for sending at the next opportunity.
[0138] In an embodiment, the root PD may also provide a yield() service to the API, which may complete the current epoch and call the scheduler or cause the current epoch to be preempted. In an embodiment, the scheduler may create new capabilities and coordinate safe garbage collection. Thus, if no messages are waiting in the queue for the current logical processor, the scheduler may steal some from other logical processors with appropriate synchronization.
[0139] In an embodiment, the scheduler may further copy the message capability so that the destination PD can access it, and ultimately, the scheduler may jump to the entry point of the destination PD (e.g., as may be specified in an ELF file and stored in a PD information structure by the runtime environment), passing the message capability on the stack.
[0140] Note that, in an embodiment, the runtime environment may use a service addressing mechanism that supports location transparency, such as, for example, IP addressing or a globally unique identifier (GUID), to allow services to send messages to other services within the same runtime environment instance as well as within other instances (which may, for example, be remotely located). In an embodiment, the runtime environment may automatically detect when a message needs to be directed to a different runtime instance, and may perform the necessary serialization and network communications to achieve the transfer.
[0141] Described next are several examples of generating and using encrypted pointers to regulate access to a shared memory region in a runtime environment according to various embodiments. For ease of illustration, a simplified example memory layout with two protection domains is assumed, each with a dedicated memory region in which one or more functions may reside. It is also assumed that both protection domains have access to the shared memory region. Figure 8 An exemplary memory layout is shown, and Fig.9Aand Fig. 9B Several example pointers generated and / or used by functions residing in a protection domain and how they are handled by the runtime environment are shown. Note that Figure 8 A similar but more detailed memory layout to that shown in FIG. 1 described above is shown.
[0142] refer to Figure 8 , shows a memory area 800. The memory area 800 includes dedicated memory areas for protection domain A 805 and protection domain B 810 and a shared heap 840 that can be accessed by functions running in any PD. PD A 805 is allocated a dedicated area of memory ranging from memory address 0x0010 to 0x00FF. In this memory area, function A.0 801, dedicated object A.1 803 (16 bytes) and dedicated object A.2 807 (128 bytes) are stored.
[0143] Continue to refer Figure 8 , PD B 810 is also shown, which is also assigned its own private area in memory area 800, ranging from memory address 0x0100 to 0x0200. In this memory area, function B.0 811, function B.1 813 and private object B.2 817 (64 bytes) are stored. Finally, memory area 800 has a memory area that can be accessed by functions in PD A 805 and PD B 810. This is a shared heap 820, which starts at memory address 0x1000. Two shared objects are shown in shared heap 820, namely shared object 0 (4 bytes) 821 and shared object 1 (4 bytes) 823.
[0144] Given Figure 8 The memory area 800 and its constituent PDs are described below with reference to ten examples of the use of encrypted pointers in this exemplary environment according to various embodiments. These examples are presented in Fig.9A and Fig. 9B middle. Fig.9A shows the encrypted pointer described in Example 1-8, Fig. 9B The encrypted pointer described in Examples 9 and 10 is shown. Note that in the following description, the terms "encrypted pointer" and "capability" are used interchangeably. Also note that in Fig.9A and Fig. 9B In the pointer fields of the capabilities shown, only the unencrypted portion of the memory address is shown for ease of explanation.
[0145] The first example, Example 1, involves Fig.9AHere, function A.0 of PD A uses the ENCCAP instruction to generate an encrypted code capability for indirect branching after the DECCCAP instruction. It can be recalled here that the example ENCCAP instruction representing "encryption capability" can be used to encrypt data capabilities for controlling memory access to objects and code capabilities for controlling branches to code. On the decryption side, as Figure 3 As shown, the DECCCAP function can be used to decrypt the encoded code capability (such as encrypted pointer 930). Figure 2 As described, Fig.9A and Fig. 9B The example pointers of each have a permanent field, an object size field, and a pointer field. Encrypted pointer 930 can be permanent or temporary, as indicated by the "0 or 1" value of the permanent field. Because encrypted pointer 930 is a code capability, its object size field is 1, recalling that the object size field provides the log2 of the actual size of the object. The pointer field contains the base address 0x0027, which falls within function A.0, and this address is in Figure 8 The pointer thus points to the authorized memory address of the PD A within its dedicated code area.
[0146] Example 2 involves an encrypted data pointer 935. Here, function A.0 of PD A 805 uses ENCCAP to generate an encrypted data capability for private object A.1 803. Thus, the object size field of encrypted data pointer 935 indicates that the object is 16 bytes long (log2(16)=4), and the base address of the object specified by the capability is 0x0040, which is the starting address of private object A.1 803, as shown in FIG. Figure 8 as shown in .
[0147] Example 3 involves the revised data capability 940 generated when function A.0 801 of PD A adds 7 to the capability from Example 2. Thus, capability 940 is identical to encrypted data pointer 935, except that the address in the pointer field is 0x0047, which is exactly 7 bytes greater than the base address used in encrypted data pointer 935. Because the size of private object A.1 803 is 16 bytes, 0x0047 correctly points to a location within private object A.1 803.
[0148] Example 4 involves a further change to the encrypted data capability of Example 3. Here, function A.0 adds 12 to the capability from Example 3, resulting in capability 945. However, the address is now out of bounds, having exceeded the size of private object A.1 803, which is 16 bytes. Capability 945 now points to address 0x0053, which exceeds the end address of private object A.1 803, which is 0x0050. Therefore, Example 5 involves this out-of-bounds capability being passed by function A.0 to a DECDCAP instruction, which generates an error, with one of the constrained bits (bit 4) being modified. Recalling Figure 2 and Figure 3 As described above, in an embodiment, the DECDCAP decryption instruction utilizes adjustment information as part of the decryption. The adjustment information specifies the constrained lower address bits, which are calculated as [25-log2(obj.size)]230, such as Figure 2 As shown in . Because the size of the dedicated object A.1 803 is 16 bytes, the constrained bits are calculated as [25:log2(16)]=[25:4], which means that bits 25:4 of the encrypted pointer are constrained and included in the adjustment information. Because bit 4 is now modified in Example 4, decrypting the capability 950 using DECDCAP results in an error, and in an embodiment, the microservice that caused the error, here function A.0, can be terminated by the runtime.
[0149] Note that in Examples 1-5, the permanent fields of various capabilities are shown as 0 or 1. This is because the data object or code instruction pointed to by the capability is in the dedicated memory area of the PDA and can be permanent. The capability is generated by the ENCCAP instruction in the PDA, and their lifetimes can all be set to permanent, or if they are not needed in any future epoch, they can be set to transient (i.e., valid only for one epoch). The benefit of using transient capabilities when possible is that the risk of undetected erroneous or damaged memory access is low, because the memory access is more likely to try to use expired capabilities later, which may cause detectable errors. The remaining examples, i.e., Examples 6-10, all have 0 values in the permanent field, because the described capabilities involve access to shared objects residing in the shared heap 820, and the runtime environment therefore only authorizes its use within a defined time. It should be understood that, alternatively, in an embodiment, the runtime environment can authorize its permanent use.
[0150] Example 6 involves (root PD using ENCCAP to generate) function A.0 from (PD A) Figure 8epoch). Therefore, as a shared object, the persistent field is set to 0 for capabilities that are valid only for a single epoch. For an object size of 32 bytes, the size field of data capability 955 is 5, and the pointer field indicates an address of 0x1000, all of which are exact for shared object 0 821, as Figure 8 As shown in . The root PD will execute ENCCAP and encrypt the capabilities using the PDID of PD A.
[0151] Example 7 involves function A.0, and now the root PD is requested to transfer the capabilities described in Example 6 to PD B, which has its entry point at the beginning of function B.0 811. Note here that although Figure 8 Although the example does not have access to PD B, function A.0 can still know about PD B. This is because it is common for microservices to use service discovery components to locate certain types of services with which they may need to communicate. Alternatively, a predefined service identifier (e.g., an IP address and port number, a GUID, a local PDID, or a local service name) can be embedded within the service as the destination for certain types of messages. Continuing with Example 7, according to Figure 5 0, the request of function A.0 causes the root PD to decrypt the input capability using a decryption instruction, such as DECDCAP, using the encryption key described above, then execute a new key generation instruction, such as INCEPOCH, as described above, to create a new encryption key, and finally, use an encryption instruction, such as ENCCAP, to generate capability 960 that can be passed to function B.0. Capability 960 is the same as capability 955 from Example 6, except that the encrypted slice of the pointer field (not shown in capability 960) is now encrypted using the new key generated by INCEPOCH. Alternatively, if PD A has not completed execution in the current epoch at the time it issues the request to transfer the capability to PD B, the capability can be queued for later transmission to PDB.
[0152] The next two examples are variations of Example 7 and are therefore numbered 7.5 and 7.6 respectively.
[0153] As mentioned, Example 7.5 involves a variation of Example 7. In Example 7.5, function A.0 now requests the root PD to transfer the capability derived from the capability of Example 6 to PD B, which has its entry point at the beginning of function B.0811. In this example, function A.0 wishes to grant access to only the first four bytes of shared object 1823 to PD B, so it uses an instruction that reduces the size of the object of a given capability. In an embodiment, this can be a new NARROWCAP instruction, as described in detail below. Executing the NARROWCAP instruction generates a new capability using the same base address as the original capability, but now using the reduced size. Capability 961 is the resulting reduced capability, showing the same base address as capability 955, but with a size field reduced to 2, representing 4 bytes. After processing as described in the latter part of Example 7, the root PD then transfers capability 961 to PD B (i.e., decryption, generation of a new key, re-encryption using the new key, and then either passing it to PD B or enqueuing it for subsequent sending to PD B).
[0154] Example 7.6, in yet another variation of Example 7, involves function A.0 shrinking a capability for passing to one of its internal basic blocks, thereby limiting access to the portion of the object from that basic block. Here, function A.0 only wants to grant access to the first four bytes of shared object 1823 to that basic block, so it can use a capability shrink instruction (e.g., NARROWCAP) to generate a new capability with the same base address as in the original capability but with a reduced size. Capability 963 is the resulting shrunken capability, and the basic block of function A.0 can then use capability 963 for memory access to the relevant portion of shared object 1 within that basic block.
[0155] Figure 8 and Fig.10 Shown in Fig. 9B . With reference thereto, Example 8 involves function A.0 801 being called again by the root PD after function B.0 completes. It passes capability 955 from Example 6 to the DECDCAP instruction. Because the root PD has called INCEPOCH after the capability was generated, the result from DECDCAP has a garbled encryption slice, resulting in subsequent memory accesses that may cause page faults. In other words, even if the originator of capability 955 is PD A, once the capability has been transferred to PD B and a new key is generated for use with the ENCCAP instruction, capability 955 can no longer be used by PD A unless PD B requests that the capability be transferred back to PD A, which would be the inverse of Example 7. Example 8 therefore illustrates that, in an embodiment, an expired capability cannot be successfully reused without a high probability of this detection.
[0156] Example 9 involves a remote adversary who causes a pointer used by function B.0 811 (such as pointer P.0) to be corrupted by sending a message over a network to a machine running function B.0 811. The corrupted pointer, referred to for ease of explanation as "P.0X," causes the original contents of pointer P.0 to be overwritten with new contents controlled or specified by the adversary. In attempting to leak data from shared object 1 823, the adversary's pointer P.0X points to shared object 1 823 because the adversary has a priori knowledge that function B.0 will eventually read the data pointed to by P.0 and send the read data over the network. However, because all uses of pointers in the program are preceded by a DECDCAP instruction, the adversary's attempt fails. Because P.0 has been overwritten with a normal pointer P.0X, an attempt to use P.0X will most likely result in an exception - either due to failing a check in DECDCAP, such as Figure 5 The check shown at 540 in is either a result of the output of DECDCAP pointing to an unmapped memory address. In other words, because in an embodiment, all pointers are encrypted, by attempting to create a regular pointer to an object in memory, the adversary causes DECDCAP to operate on the created regular pointer, which will not be decrypted, or, if it somehow can, will not point to the actual memory location expected by the adversary.
[0157] Next, Example 10 is described. With reference to this, in Example 10, it is assumed that the remote adversary obtains the original content of pointer P.0970 in some way. For example, this may be function B.0811 (which mistakenly sends the content of P.0970 to the network) Figure 8 ). The adversary attempts to undetectably corrupt P.0 970 using its knowledge of the original contents of P.0, so that the corruption will not be detected. For illustration purposes, assume that the original contents of P.0 970 point to Figure 8 821 of shared object 0, so the pointer field of pointer 970 has an address of 0x1000. Further assume that the adversary overwrites P.0 with the corrupted pointer value 975 in an attempt to redirect subsequent accesses away from shared object 0 and to shared object 1 823 ( Figure 8 ). However, because the constrained bits in corrupted pointer 975 are different from those in original pointer 970, and because the adversary cannot undetectably modify the ciphertext slice in pointer 975, the corrupt capability will ultimately decrypt to a pointer that may point to an unmapped memory address, causing an exception to occur when function B.0 811 attempts to access the address.
[0158] Next described are alternative methods, according to some embodiments, for ensuring code capabilities without encryption. In this context, it is noted that rather than requiring encrypted code capabilities as described above, in alternative embodiments a check may be made at the destination of each branch to verify that the branch operation has been authorized. These alternative methods may be implemented in embodiments using The company's Control Flow Enforcement Technology (CET) and uses The company's Memory Protection Extensions (MPX) are used on computing devices. MPX is a mechanism for checking memory boundaries, and CET is a mechanism for restricting indirect branch targets to enforce control flow integrity, among other things. MPX introduces new boundary registers, and new instruction set extensions that operate on these registers. In addition, MPX provides a new set of "boundary tables" that store boundaries beyond which boundary registers can fit. In an embodiment, two mechanisms can be used to implement this functionality.
[0159] Alternatively, these methods may also be implemented on other computing devices with equivalent or similar mechanisms for checking or validating memory boundaries, and mechanisms for limiting indirect branch targets to those that are allowed.
[0160] In a first alternative, in an embodiment, CET (or equivalent) may be enabled so that all indirect branches must be located on ENDBRANCH instructions or their equivalents. Note here that ENDBRANCH (or specifically ENDBR 64, for 64-bit mode) is ENDBRANCH is a 32-bit ENDBRANCH instruction that must be present to mark a given location in the code as a valid target for an indirect branch, i.e., one that branches to an address contained in a register. Otherwise, if the indirect branch is on some other instruction, an error will be generated when the ENDBRANCH check is enabled. Note further that, as used herein, "ENDBRANCH" may refer to both the 64-bit and 32-bit versions of the instruction, specifically "ENDBR64" and "ENDBR32", respectively.
[0161] In an embodiment, a bounds check may be performed after each ENDBRANCH instruction to verify that the current instruction pointer (i.e., code location) is within the boundaries of the code region of the current PD. In an embodiment, a special ENDBRANCH instruction may also be provided that lacks an associated MPX bounds check in the root PD, since any PD is authorized to call the root PD at this entry point. In such an embodiment, this would be the entry point for calling root PD functionality, such as sending messages to other PDs and yielding control of the scheduler. The following description Fig.10This exemplary use of CET and MPX (or equivalent) to control indirect branches in such an embodiment is shown. Note that although Fig.10 Reference is made to CET and MPX, but in alternative embodiments the functionality shown may be implemented using equivalents of CET and MPX.
[0162] refer to Fig.10 , two protection domains are shown, protection domain #1 1010 and protection domain #2 1020. Protection domain #1 1010 has four functions running therein, namely, functions 1011, 1013, 1015, and 1017. Function 1011 has two indirect branches, one in each of functions 1013 and 1015. Similarly, functions 1013 and 1015 each have an indirect branch to function 1017. In addition, function 1015 also indirectly branches to function 1033 of protection domain #2 1030.
[0163] Similarly, protection domain #2 1030 has its own four functions, functions 1031, 1033, 1035, and 1037. Function 1031 has an indirect branch to function 1033, and function 1033 has an indirect branch to each of functions 1035 and 1037. As described above, each indirect branch in each protection domain arrives at an ENDBRANCH instruction, and as also described above, in an embodiment, an MPX bounds check may be performed after the ENDBRANCH instruction is pointed to.
[0164] As shown, at 1020, the indirect branch from function 1015 of protection domain #1 1010 to function 1033 of protection domain #2 1030 is blocked by MPX and CET. Therefore, in embodiments using MPX and CET, a coarse-grained MPX boundary check may be added after each ENDBRANCH instruction to ensure that the new RIP is within the boundaries of the code segment of the currently active protection domain. In these alternative embodiments, code capabilities do not need to be encrypted, so Figure 1B The process shown, blocks 150 and 160 will be limited to inserting the encryption instructions of the generated pointer into the data. Therefore, in such an embodiment, the encryption instructions (e.g., ENCCAP) will simply not be called to generate code capabilities. It will only be called to generate data capabilities.
[0165] In an embodiment, another alternative method may be to extend the ENDBRANCH instruction (or equivalent) to receive an immediate operand, specifying the PDID of the PD in which the ENDBRANCH instruction can be successfully executed. Note here that immediate operands are by definition numerical values embedded in the code, so they will be embedded when the PD is compiled or at some later point (e.g., when the PD is loaded). Therefore, if an indirect branch arrives on an ENDBRANCH instruction (specifying a PDID different from the current PDID, which may be contained in, for example, an internal CPU register), an error may be generated. In such an embodiment, a PDID value of 0 may be used to specify that any indirect branch is allowed to arrive on the ENDBRANCHI instruction (e.g., used at an authorized entry point into the root PD). Similarly, in such an embodiment, an ENDBRANCH instruction that does not contain any immediate operands may be targeted by any indirect branch.
[0166] As described above, in some embodiments, an instruction may be defined to reduce the boundary of a capability. The instruction may be called "NARROWCAP", for example, and may have the following interface:
[0167] NARROWCAP r64, r64,
[0168] and may operate as follows. An instruction may read the input capability from a first register and the desired reduced size from a second register. The instruction may then decrypt the input capability, replace its object size field with the contents of the second register, and then re-encrypt the input capability with the new object size, where the object size must be smaller than the object size specified in the original input capability, e.g., Figure 3 The object size field 310 is shown. In an embodiment, if the new object size after NARROWCAP execution is not less than the original value, an error may be generated.
[0169] Additionally, in an embodiment, NARROWCAP may support changing the base of a capability and may check that the final bounds of the new capability do not exceed the bounds of the input capability in any direction. In an embodiment, this extended functionality may specify a new object base based on additional operands. The checks performed by NARROWCAP described above are used to prevent instructions from being misused to grant access to more memory than the input capability once authorized.
[0170] Note also that in embodiments where permission metadata is embedded in the capabilities, such as by including bits indicating whether memory is readable, writable, executable, etc., in such embodiments, the NARROWCAP instruction may also support restricting that metadata as well, in addition to simply restricting the range of accessible memory as described above. Thus, to support these embodiments, NARROWCAP may be extended to accept a third r64 operand specifying new permissions, and its execution may also include a check to only accept a permission specification if it is more restrictive than the existing permissions in the original capabilities input to the NARROWCAP instruction.
[0171] Note that in an embodiment, the NARROWCAP instruction may be instrumented by the compiler and executed at runtime.
[0172] Finally, in the context of encryption instructions (e.g., ENCCAP) as described above, note that in order to use ENCCAP within a non-root PD, the memory referred to must be within a dedicated area owned by that PD. In embodiments, this can be verified in a variety of ways. In embodiments, the compiler and runtime loader may be able to statistically verify that objects are within those boundaries by inspecting the code. Alternatively, the runtime may require MPX type or arithmetic bounds checking before ENCCAP instructions execute.
[0173] Next described are three examples related to embodiments using the ENDBRANCH instruction described above. Figure 8 In the first example, as an alternative to using ENCCAP and DECCCAP to restrict control flow, the ENDBRANCH instruction and MPX can be used instead. Therefore, assuming Figure 8 A branch with label "dest." as the target in function A.0 801 of , may use a normal unencrypted pointer to direct the branch. As described above, the ENDBRANCH instruction is the first instruction at label "dest", and therefore, execution is allowed to continue to the next instruction. Further, two MPX bounds checking instructions may be used to check the current instruction pointer (i.e., code location) against the lower and upper code boundaries for the current PD (protection domain A 805). If either check fails, an exception is generated. Otherwise, execution continues.
[0174] In a second example, assume that function B.1 813 of protection domain B 810 may be malicious and may attempt to branch to "dest." in function A.0 801. This would be an unauthorized branch because function B.1 and function A.0 are in different protection domains. The MPX floor check instruction following the dest label will therefore generate an exception because the address of "dest." (0x0027) is below the floor of PD B's code (0x0100).
[0175] In a third example, instead of using MPX bounds checking, in an embodiment, the ENDBRANCH instruction itself may be extended with an immediate operand that may be checked for equality with the contents of an internal CPU register representing an authorized ENDBRANCH ID for the current PD. If the second example above is replayed in this context, the ENDBRANCH ID check at "dest." will fail.
[0176] In a fourth example, as an alternative to using MPX bounds checking, in an embodiment, the ENDBRANCH instruction may be followed by a compare instruction having an immediate operand specifying a PDID to be compared with the thread-local memory location for the currently active PDID. If the two PDIDs do not match, then the subsequent branch transfers control to the handler.
[0177] In a fifth example, as an alternative to using an MPX bounds check on the current instruction pointer, in an embodiment, the ENDBRANCH instruction may be followed by an instruction that reads the current shadow stack pointer and an MPX bounds check or equivalent arithmetic instruction to verify that the current shadow stack pointer is within the bounds of the shadow stack of the current PD. Alternatively, the current stack pointer may be verified to be within the bounds of the stack of the current PD.
[0178] Finally, in a sixth example, as an alternative to using an MPX bounds check on the current instruction pointer, in an embodiment, the ENDBRANCH instruction may be followed by an instruction to load the PDID of the code region in which it resides and an MPX bounds check to verify that the loaded PDID matches the current PDID. The current PDID will be stored in the MPX bounds registers as lower and upper bounds, so that a pair of BNDCN and BNDCL instructions or their equivalents may be used to check the loaded PDID. The BNDCL instruction uses the bounds register lower value to check the lower bound, and the BNDCN instruction uses the bounds register upper value to check the upper bound.
[0179] Reference now Fig.11, wherein a block diagram of a computer device suitable for practicing the present disclosure according to various embodiments is shown. As shown, the computer device 1100 may include one or more processors 1102, a memory controller 1103, and a system memory 1104. Each processor 1102 may include one or more processor cores and a hardware accelerator 1105. Examples of hardware accelerators 1105 may include, but are not limited to, programmed field programmable gate arrays (FPGAs). In an embodiment, the processor 1102 may also include a memory controller (not shown). In an embodiment, the processor may be configured to support ISA, and the ISA supports instructions ENCCAP, DECDCAP, DECCCAP, NARROWCAP, INCEPOCH, ENDBRANCH, or their equivalents. The system memory 1104 may include any known volatile or non-volatile memory.
[0180] In addition, the computer device 1100 may include a mass storage device 1106 (such as a solid state drive), an input / output device interface 1108 (to interface with various input / output devices, such as a mouse, a cursor control, a display device (including a touch-sensitive screen), etc.), and a communication interface 1110 (such as a network interface card, a modem, etc.). In an embodiment, the communication interface 1110 may support wired or wireless communications, including near-field communications. The elements may be coupled to each other via a system bus 1112, which may represent one or more buses. In the case of multiple buses, they may be bridged by one or more bus bridges (not shown).
[0181] Each of these elements can perform its conventional functions as known in the art. In particular, system memory 1104 and mass storage device 1106 can be used to store an operating system, one or more applications, and various modules (collectively referred to as computing logic 1122, which may include a compiler, which compiler 100A can be configured to have an architecture and practice as Figure 1A and Figure 1B The process 100B described herein (aspects thereof) and having a configuration to practice Figure 6 The executable code generated by the compiler for the computer program may include a working copy and a permanent copy of the executable code of the programming instructions of the process 600 (the runtime environment of the process 600). In an embodiment, as previously described, the executable code generated by the compiler for the computer program may include the executable code as previously described in reference Figure 1A and Figure 1BThe encryption instructions and decryption instructions described herein. During the execution of the generated instructions, the runtime environment may provide a mechanism for one part of the computer program to send authorization to another part of the computer program to access a certain segment of memory. The programming instructions implementing the computing logic 1122 may include assembly instructions supported by the processor 1102 or a high-level language (e.g., C) that can be compiled into such instructions. In an embodiment, some of the computing logic may be implemented in the hardware accelerator 1105. In an embodiment, portions of the computing logic 1122, such as portions of the computing logic 1122 associated with the runtime environment of the compiler, may be implemented in the hardware accelerator 1105.
[0182] A permanent copy of the executable code of the programming instructions or bitstream used to configure the hardware accelerator 1105 may be placed into a permanent mass storage device 1106 and / or the hardware accelerator 1105 at the factory or in the field via, for example, a distribution medium (not shown) such as a compact disk (CD), or via a communication interface 1110 (from a distribution server (not shown)). Although for ease of understanding, the compiler and the hardware accelerator that execute the generated code (including the predicate computation teachings of the present disclosure to enhance pipelining and / or parallel execution of nested loops) are shown as being located on the same computing device, in alternative embodiments, the compiler and the hardware accelerator may be located on different computing devices.
[0183] The number, capabilities, and / or capacity of these elements 1110-1112 may vary depending on the intended use of the example computing device 1100, such as whether the example computing device 1100 is a smartphone, a tablet device, an ultrabook, a laptop, a server, a set-top box, a game console, a camera, etc. The composition of these elements 1110-1112 may be known in other ways and therefore will not be described further.
[0184] Fig.12 An example computer-readable storage medium according to various embodiments is shown, wherein there are instructions configured to implement and / or practice the above-described Figure 1A , Figure 1B , Figure 4 , Figure 5 and Figure 6 Processes: processes performed by compiler 100A, 100B, 400, 500 and 600 (aspects). As shown, computer-readable storage medium 1202 may include executable code of multiple programming instructions or bit streams 1204. The executable code of programming instructions (or bit streams) 1204 may be configured to enable a device (such as computer device 1100 (especially hardware accelerator 1105)) to perform operations respectively in response to the execution of the executable code / programming instructions (or the operation of the encoded hardware accelerator 1205). Figure 1A , Figure 1B , Figure 4 , Figure 5 and Figure 6 Processes: Processes performed by compilers 100A, 100B, 400, 500, and 600 (aspects thereof). In alternative embodiments, executable code / programming instructions / bitstream 1204 may be arranged on multiple non-transitory computer-readable storage media 1202. In an embodiment, computer-readable storage media 1202 may be non-transitory. In other embodiments, executable code / programming instructions 1204 may be encoded in a transitory computer-readable medium, such as a signal.
[0185] Return to reference Fig.11 For one embodiment, at least one processor 1102 may be packaged with a computer-readable storage medium having a compiler or runtime environment for some or all of the computing logic 1122 (instead of being stored in the system memory 1104 and / or the mass storage device 1106), which is configured to practice the previously referenced Figure 3 , Figure 4 , Figure 5 and Figure 6 All or selected operations of the described operations. For one embodiment, at least one processor 1102 may be packaged with a computer-readable storage medium having some or all of a compiler or runtime environment of computing logic 1122 to form a system-in-package (SiP). For one embodiment, at least one processor 1102 may be integrated on the same die with a computer-readable storage medium having some or all of a compiler or runtime environment of computing logic 1122. For one embodiment, at least one processor 1102 may be packaged with a computer-readable storage medium having some or all of a compiler or runtime environment of computing logic 1122 to form a system-on-chip (SoC). For at least one embodiment, the SoC may be used in, for example, but not limited to, a hybrid computing tablet device / laptop computer.
[0186] Illustrative examples of the technology disclosed herein are provided below. Embodiments of the technology may include any one or more of the examples described below and any combination thereof.
[0187] Example
[0188] Example 1 may include an apparatus for computing, comprising: one or more processors; a memory; and a compiler operated by the one or more processors to compile a computer program, wherein the compiler includes: one or more analyzers for parsing and analyzing the source code of the computer program that generates a pointer or dereferences a pointer. The compiler may also include a code generator coupled to the one or more analyzers to generate executable instructions for the source code of the computer program, including inserting additional encryption or decryption executable instructions into the computer program based at least in part on the results of the analysis to authenticate the memory access operation of the source code.
[0189] Example 2 may include the apparatus of Example 1 and / or other examples herein, wherein: the additional executable instructions include: encryption instructions to be inserted after any source code of the computer program that generates a pointer; and decryption instructions to be inserted before any source code of the computer program that dereferences a pointer.
[0190] Example 3 may include an apparatus of Example 2 and / or other examples herein, wherein the encryption instruction and the decryption instruction each take as input a protection domain identifier (PDID) representing a protection domain (PD) to be loaded into a runtime environment of one or more processors for execution of the generated instructions.
[0191] Example 4 may include an apparatus of any of Examples 2 or 3 and / or other examples herein, wherein a separate PD is assigned to each of one or more applications to be loaded into a runtime environment, the one or more applications having access to a shared memory area.
[0192] Example 5 may include an apparatus of Example 2 and / or other examples herein, wherein, when executed, the output of the encryption instruction includes an at least partially encrypted pointer, and the pointer includes embedded metadata granting access to a memory location, and wherein, when the at least partially encrypted pointer is input to a decryption instruction and the decryption instruction is successfully executed, a corresponding pointer generated by source code of the computer program is obtained.
[0193] Example 6 may include the apparatus of Example 5 and / or other examples herein, wherein the execution of the decrypted instructions also requires a key, which is assigned to a PD, wherein an application executing the decrypted instructions is run by a root PD of a runtime environment of one or more processors to execute the generated instructions.
[0194] Example 7 may include an apparatus of Example 6 and / or other examples herein, wherein the key is a selected one of: a first key for encrypting a pointer that persists across multiple predefined time intervals, or a second key for encrypting a pointer that is valid only for a single predefined time interval.
[0195] Example 8 may include an apparatus of Example 7 and / or other examples herein, wherein the key is the second key, and wherein access to the memory location indicated by the encrypted pointer is revoked upon expiration of a single predefined time interval by changing the key required to execute a decryption instruction on the at least partially encrypted pointer.
[0196] Example 9 may include the apparatus of any of Examples 5-7 and / or other examples herein, wherein the at least partially encrypted pointer has a size equal to a size of a corresponding pointer to be generated by source code of the computer program.
[0197] Example 10 may include an apparatus of Example 5 and / or other examples herein, wherein the at least partially encrypted pointer comprises three fields: a permanent field, an object size field, and a pointer field, and wherein: the permanent field is used to indicate whether the encrypted pointer will not expire or is valid only for a single predefined time interval, the object size field specifies the size of the object in the memory to which the encrypted pointer grants access rights, and the pointer field specifies the address of the object in the memory.
[0198] Example 11 may include the apparatus of Example 10 and / or other examples herein, wherein the encryption instruction specifies that only a portion of the pointer field is to be encrypted, the portion including a plurality of most significant bits of the pointer field.
[0199] Example 12 may include the apparatus of Example 11 and / or other examples herein, wherein the object size field and multiple unencrypted bits in the pointer field are incorporated into adjustment information for decrypting the at least partially encrypted pointer.
[0200] Example 13 may include the apparatus of any of Examples 5-7 and / or other examples herein, further comprising a fixed block size cipher for at least partially encrypting the at least partially encrypted pointer.
[0201] Example 14 may include an apparatus of any of Examples 5-7 and / or other examples herein, wherein the decryption instruction takes as input the at least partially encrypted pointer, the PDID of the PD that generates the pointer, and adjustment information, the adjustment information comprising: the PDID, the object size field, and a predetermined number of unencrypted least significant bits of the pointer field of the at least partially encrypted pointer.
[0202] Example 15 may include the apparatus of Example 2 and / or other examples herein, further comprising: an associated runtime manager of the compiler, for checking each executable instruction of the compiled computer program before execution, generating a pointer or dereferencing a pointer to confirm that the associated encryption instruction or the associated decryption instruction is inserted by the compiler, and preventing the compiled source code from being executed in response to a confirmation failure.
[0203] Example 16 may include the apparatus of Example 1 and / or other examples herein, wherein the additional decryption instruction includes a decryption instruction for a pointer used for data access, or a decryption instruction for a pointer used in a branch instruction.
[0204] Example 17 may include one or more non-transitory computer-readable storage media, including multiple instructions that, in response to being executed, cause a computing device to provide a compiler to compile a computer program for: parsing and analyzing source code of the computer program that generates pointers or dereferences pointers; and generating executable instructions for the source code of the computer program, including inserting additional encryption or decryption executable instructions into the computer program based at least in part on the results of the analysis to limit the processor's memory access operations to authorized processes.
[0205] Example 18 may include one or more non-transitory computer-readable storage media of Example 17 and / or other examples herein, wherein: the additional executable instructions include: encryption instructions to be inserted after any source code for generating a pointer in the computer program; and decryption instructions to be inserted before any source code for dereferenced pointers in the computer program.
[0206] Example 19 may include one or more non-transitory computer-readable storage media of Example 17 and / or other examples herein, wherein the encryption instructions and the decryption instructions each take as input a protection domain identifier (PDID) representing a protection domain (PD) to be loaded into a runtime environment of the computing device in order to execute the generated instructions.
[0207] Example 20 may include one or more non-transitory computer-readable storage media of Example 17 or 18 and / or other examples herein, wherein, when executed, the output of the encrypted instructions includes an at least partially encrypted pointer, and the pointer includes embedded metadata granting access to the memory location.
[0208] Example 21 may include one or more non-transitory computer-readable storage media of Example 20 and / or other examples herein, wherein, when an at least partially encrypted pointer is input into a decryption instruction and the decryption instruction is successfully executed, a corresponding pointer generated by the source code of the computer program is obtained.
[0209] Example 22 may include one or more non-transitory computer-readable storage media of Example 21 and / or other examples herein, wherein execution of the decryption instructions also requires a key, which is assigned to a PD, wherein an application executing the decryption instructions is run by a root PD of a runtime environment of one or more processors to execute the generated instructions.
[0210] Example 23 may include one or more non-transitory computer-readable storage media of Example 22 and / or other examples herein, wherein the key is a selected one of: a first key for encrypting a pointer that persists across multiple predefined time intervals, or a second key for encrypting a pointer that is valid only for a single predefined time interval.
[0211] Example 24 may include one or more non-transitory computer-readable storage media of Example 23 and / or other examples herein, wherein the key is the second key, and wherein access to the memory location indicated by the encrypted pointer is revoked upon expiration of a single predefined time interval by changing the key required to execute a decryption instruction for the at least partially encrypted pointer.
[0212] Example 25 may include one or more non-transitory computer-readable storage media of Example 20 and / or other examples herein, wherein the at least partially encrypted pointer includes three fields: a permanent field, an object size field, and a pointer field, and wherein: the permanent field is used to indicate whether the encrypted pointer does not expire or is valid only for a single predefined time interval, the object size field specifies the size of an object in the memory of the computing device to which the encrypted pointer is granted access, and the pointer field specifies the address of the object in the memory of the computing device.
[0213] Example 26 may include one or more non-transitory computer-readable storage media of Example 25 and / or other examples herein, wherein the encryption instructions specify that only a portion of the pointer field is to be encrypted, the portion including multiple most significant bits of the pointer field.
[0214] Example 27 may include one or more non-transitory computer-readable storage media of Example 26 and / or other examples herein, wherein multiple unencrypted bits in the object size field and the pointer field are incorporated into adjustment information for decrypting the at least partially encrypted pointer.
[0215] Example 28 may include one or more non-transitory computer-readable storage media of Example 20 and / or other examples herein, wherein execution of the encryption instruction also requires a fixed block size password for at least partially encrypting the at least partially encrypted pointer.
[0216] Example 29 may include one or more non-transitory computer-readable storage media of Example 20 and / or other examples herein, wherein the decryption instructions take as input an at least partially encrypted pointer, a PDID of a PD that generated the pointer, and adjustment information.
[0217] Example 30 may include one or more non-transitory computer-readable storage media of Example 29 and / or other examples herein, wherein the adjustment information includes: the PDID, the object size field, and a predetermined number of unencrypted least significant bits of a pointer field of an at least partially encrypted pointer.
[0218] Example 31 may include one or more non-transitory computer-readable storage media of Example 17 and / or other examples herein, and further cause the computing device to provide an associated runtime manager of the compiler when executing the plurality of instructions to check each executable instruction of the compiled computer program that generates a pointer or dereferences a pointer before execution to confirm that the compiler has inserted an associated encryption instruction or an associated decryption instruction, and to prevent execution of the compiled source code in response to a failure to confirm.
[0219] Example 32 may include a method for authenticating access to a memory area shared by one or more applications running on a computing device, comprising: receiving a first request from a function running in a protection domain (PD) of a runtime environment for the ability to allocate an object in shared memory and generate access to it; assigning a key to the PD and generating an encrypted pointer to the memory location of the object using an identifier (PDID) of the PD and the key; receiving a second request from a function running in the PD for the ability to use the capability; and decrypting the capability and passing an unencrypted pointer to the object to the function.
[0220] Example 33 may include the method of Example 32 and / or other examples herein, wherein the encrypted pointer includes metadata indicating the following information: the size of the object, and whether the encrypted pointer persists for several predefined time intervals of the runtime environment, or whether it expires after a predefined time interval of the runtime environment.
[0221] Example 34 may include the method of Example 32 and / or other examples herein, wherein the key is assigned to the PD by a root PD of the runtime environment.
[0222] Example 35 may include the method of Example 32 and / or other examples herein, wherein assigning the key to the PD includes assigning the key to an epoch active while the PD is running.
[0223] Example 36 may include the method of Example 32 and / or other examples herein, wherein the key expires after a predefined time interval of the runtime environment, and further includes expiring the key by changing the key assigned to the PD.
[0224] Example 37 may include the method of Example 32 and / or other examples herein, further comprising: determining whether the second request includes a function to transfer the ability to access the object to another PD of the runtime environment.
[0225] Example 38 may include the method of Example 37 and / or other examples herein, further including: in response to the determination, decrypting the encrypted pointer using the current key of the PD, generating and assigning a new key for another PD, and re-encrypting the decrypted pointer using the PDID of another PD and the new key assigned to the other PD.
[0226] Example 39 may include the method of Example 37 and / or other examples herein, further comprising: determining whether the other PD is not in operation or is not ready for incoming capabilities, and in response to the determination, enqueuing a decrypted pointer using information specifying the identity of the other PD.
[0227] Example 40 may include the method of Example 39 and / or other examples herein, further comprising, upon receiving another PD ready to accept incoming capabilities, encrypting the decrypted capabilities using a key for the other PD and transferring the capabilities to the other PD.
[0228] Example 41 may include the method of Example 32 and / or other examples herein, wherein the second request comprises a request to reduce the size of an object to be accessed using the capability.
[0229] Example 42 may include the method of Example 41 and / or other examples herein, further comprising decrypting the capability, replacing an object size field of the capability with the reduced size, and re-encrypting the capability.
[0230] Example 43 may include one or more non-transitory computer-readable storage media including a plurality of instructions that, in response to being executed, cause a computing device to perform the method of any of Examples 32-42.
[0231] Example 44 may include an apparatus for computing, comprising: a unit for receiving a first request from a function running in a protection domain (PD) of a runtime environment to allocate an object in a shared memory and generate a capability to access it; a unit for assigning a key to the PD and generating an encrypted pointer to a memory location of the object using an identifier (PDID) of the PD and the key; a unit for receiving a second request from a function running in the PD to use the capability; and a unit for decrypting the capability and passing an unencrypted pointer to the object to the function.
[0232] Example 45 may include an apparatus for computing of Example 44 and / or other examples herein, wherein the encrypted pointer includes metadata indicating the following information: the size of the object, and whether the encrypted pointer persists for several predefined time intervals of the runtime environment, or whether it expires after a predefined time interval of the runtime environment.
[0233] Example 46 may include the apparatus for computing of Example 44 and / or other examples herein, wherein the unit for dispatching includes a root PD of the runtime environment.
[0234] Example 47 may include the apparatus for computing of Example 44 and / or other examples herein, wherein the means for assigning comprises means for assigning the key to an epoch active at the time of the PD runtime.
[0235] Example 48 may include the apparatus for computing of Example 44 and / or other examples herein, wherein the key expires after a predefined time interval of the runtime environment, and further includes a unit for expiring the key including a unit for changing the key assigned to the PD.
[0236] Example 49 may include the apparatus for computing of Example 44 and / or other examples herein, further comprising a unit for determining whether the second request includes a function to transfer the capability to access the object to another PD of the runtime environment.
[0237] Example 50 may include an apparatus for computing of Example 49 and / or other examples herein, wherein the unit for decrypting is also used to decrypt an encrypted pointer using a current key of the PD, the unit for dispatching is also used to generate and dispatch a new key for another PD, and the unit for encrypting is also used to re-encrypt the decrypted pointer using the PDID of another PD and the new key dispatched to the other PD.
[0238] Example 51 may include an apparatus for computing of Example 49 and / or other examples herein, further comprising: a unit for determining whether another PD is not in operation or is not ready for incoming capabilities, and a unit for enqueuing a decrypted pointer using information specifying the identity of the other PD.
[0239] Example 52 may include the apparatus for computing of Example 49 and / or other examples herein, further comprising: a unit for receiving an indication that another PD is ready to accept incoming capabilities, a unit for encrypting the decrypted capabilities using a key of another PD, and a unit for transferring the capabilities to another PD.
[0240] Example 53 may include an apparatus for computing of Example 44 and / or other examples herein, wherein the means for receiving the second request is further for receiving a request to reduce the size of an object to be accessed using the capability.
[0241] Example 54 may include an apparatus for computing of Example 53 and / or other examples herein, wherein the unit for decrypting is also used to decrypt the capability, and further includes a unit for replacing the object size field of the capability with a reduced size, and a unit for re-encrypting the capability.
[0242] The foregoing description of one or more implementations provides examples and descriptions, but is not intended to be exhaustive or to limit the scope of the embodiments to the precise forms disclosed. Modifications and variations are possible in light of the above teachings, or may be acquired from practice of the various embodiments.
Claims
1. An apparatus for authenticating access to a memory region, comprising: a first processor; as well as a compiler operated by the first processor to compile a computer program, wherein the compiler comprises: one or more analyzers for parsing and analyzing source code of the computer program that generates pointers or dereferences pointers; and a code generator coupled to the one or more analyzers to generate executable instructions for source code of the computer program, including inserting additional encryption or decryption executable instructions into the generated executable instructions of the source code of the computer program based at least in part on a result of the analyzing to authenticate memory access operations of the source code; wherein, when the generated executable instructions of the source code of the computer program and the additional encryption or decryption executable instructions are executed by a second processor, the output of the executed encryption instructions includes an at least partially encrypted pointer, and the at least partially encrypted pointer includes embedded metadata, the embedded metadata granting access to a memory location of a memory coupled to the second processor, and wherein the at least partially encrypted pointer is input into a decryption instruction that, when the decryption instruction is executed, restores the pointer.
2. The device of claim 1, wherein: Additional executable instructions include: encrypted instructions to be inserted after any source code of the computer program that generates the pointer; and Decryption instructions to be inserted before any source code of the computer program that dereferences a pointer.
3. The device as claimed in claim 2, wherein: The encryption instruction and the decryption instruction each take as input a protection domain identifier PDID, the protection domain identifier PDID identifying a protection domain PD to be loaded into a runtime environment of the second processor.
4. The device according to claim 3, wherein: The PD is dispatched to the instructions generated by the source code of the computer program and the additional encryption or decryption executable instructions, and wherein, during execution, the instructions generated by the source code of the computer program and the additional encryption or decryption executable instructions have access to an area of memory coupled to the second processor, wherein the area is shared by other computer programs executed simultaneously by the second processor.
5. The device according to claim 4, wherein: The execution of the decryption instruction also requires a key, wherein the key is assigned to the PD.
6. The device according to claim 5, wherein: The key is a selected one of: a first key that persists across a plurality of predefined time intervals, or a second key that is valid only for a single predefined time interval.
7. The device according to claim 6, wherein: The key is the second key, and wherein access to the memory location indicated by the encrypted pointer is revoked upon expiration of the single predefined time interval by changing the key required to decrypt the instruction.
8. The device of claim 1, wherein: The at least partially encrypted pointer comprises three fields: a permanent field, an object size field, and a pointer field, and wherein: The persistence field is used to indicate whether the at least partially encrypted pointer does not expire or is valid only for a single predefined time interval, The object size field specifies the size of the object in the memory to which the at least partially encrypted pointer grants access, and The pointer field specifies the address of the object in the memory.
9. The device of claim 8, wherein: The most significant bits of the pointer field are encrypted.
10. The device of claim 9, wherein: The object size field and a plurality of unencrypted bits in the pointer field are incorporated into adjustment information to be used to affect decryption of the at least partially encrypted pointer.
11. The apparatus of any one of claims 5-7, further comprising a fixed block size cipher for at least partially encrypting the at least partially encrypted pointer.
12. The device according to any one of claims 5 to 7, wherein: The decryption instruction takes as input at least an at least partially encrypted pointer and adjustment information, wherein the adjustment information comprises: an unencrypted predefined number of least significant bits of the at least partially encrypted pointer.
13. The device of claim 1, wherein: The first processor and the second processor are the same processor, and wherein the same processor further comprises an associated runtime manager of the compiler, for checking the generated executable instructions of the source code of the computer program and each of the additional encrypted or decrypted executable instructions before execution to confirm that the associated encryption instructions or the associated decryption instructions are inserted by the compiler, and preventing the generated executable instructions of the source code of the computer program from being executed in response to a failure of confirmation.
14. The device of claim 1, wherein: The additional decryption instructions include a decryption instruction for a pointer used for data access, or a decryption instruction for a pointer used in a branch instruction.
15. One or more non-transitory computer-readable storage media comprising a plurality of instructions that, in response to being executed by a first processor of a first computing device, cause the first computing device to provide a compiler to compile a computer program, the instructions comprising: Parsing and analyzing source code of the computer program that generates pointers or dereferences pointers; as well as generating executable instructions for the source code of the computer program, including inserting additional encryption or decryption executable instructions into the generated executable instructions of the source code of the computer program based at least in part on the results of the analyzing to restrict memory access operations of a processor used to execute the generated instructions of the source code of the computer program and the additional encryption or decryption executable instructions, Wherein, when the generated executable instructions of the source code of the computer program and the additional encryption or decryption executable instructions are executed by a second processor of a second computing device, the output of the executed encryption instructions includes an at least partially encrypted pointer, and the at least partially encrypted pointer is input into a decryption instruction, and when the decryption instruction is executed, the pointer is restored.
16. The one or more non-transitory computer-readable storage media of claim 15, wherein: Additional executable instructions include: encrypted instructions to be inserted after any source code of the computer program that generates the pointer; and Decryption instructions to be inserted before any source code of the computer program that dereferences a pointer.
17. The one or more non-transitory computer-readable storage media of claim 16, wherein: The encryption instruction and the decryption instruction each take as input a protection domain identifier PDID, the protection domain identifier PDID identifying a protection domain PD to be loaded into a runtime environment of the second processor.
18. One or more non-transitory computer-readable storage media as claimed in one of claims 16 or 17, wherein: When executed, the output of the encryption instructions includes an at least partially encrypted pointer, and the pointer includes embedded metadata that grants access to a memory location of a memory coupled to the second processor, and wherein the at least partially encrypted pointer output by the encryption instructions is input into decryption instructions, and the decryption instructions are executed to recover the pointer.
19. The one or more non-transitory computer-readable storage media of claim 16, wherein: The first computing device and the second computing device are the same computing device, and wherein, when executing the plurality of instructions, the same computing device is also caused to provide an associated runtime manager of the compiler to check the generated executable instructions of the source code of the computer program and the additional encrypted or decrypted executable instructions before execution to confirm that the associated encryption instructions, or the associated decryption instructions, are inserted by the compiler, and to prevent execution of the generated executable instructions of the source code of the computer program in response to a failure of confirmation.
20. A method for authenticating access to a memory region shared by one or more applications running on a computing device, comprising: receiving, from a function executing in the protection domain PD of the runtime environment, a first request for an object in a memory region of an allocated shared memory and generating a tag for accessing the object; assigning a key to the PD and generating an encrypted pointer to a memory location of the object using an identifier PDID of the PD and the key; receiving, from a function executing in the PD, a second request to use the tag; as well as The tag is decrypted to recover an unencrypted pointer to the object, and the unencrypted pointer is passed to the function.
21. The method of claim 20, wherein: The encrypted pointer includes metadata indicating the size of the object and whether the encrypted pointer persists for a number of predefined time intervals of the runtime environment or whether it expires after a predefined time interval of the runtime environment.
22. The method of any one of claims 20 or 21, wherein: The key of the PD is assigned by a root PD of the runtime environment, and further includes expiring the key by changing the key assigned to the PD.
23. The method of any one of claims 20 or 21, wherein: The function is a first function and the PD is a first PD, and wherein the method further includes determining whether the second request includes transferring the tag for accessing the object to a second function in the second PD of the runtime environment, the second PD being identified by a second PDID, and in response to the determination, decrypting the encrypted pointer using the key of the first PD, generating and assigning a new key for the second PD, and re-encrypting the decrypted pointer using the second PDID and the new key assigned to the second PD.
24. The method according to any one of claims 20 or 21, wherein: The second request includes a request to reduce the size of the object to be accessed using the tag, and also includes decrypting the tag, replacing the object size field of the tag with the reduced size, and re-encrypting the tag.
