Various features relate to computing systems and more particularly to the preventing access to secure or sensitive resources or content.
State-of-the-art central computing systems (CPUs) often employ speculative processing and/or branch prediction to enhance performance A possible security vulnerability may arise whereby an attacker exploits speculative access to data prior to the CPU confirming the correctness of that access. The attack may include a side-channel attack (such as a cache side channel attack or branch predictor side channel attack). This may have adverse consequences for the security of sensitive data (e.g. cryptographic keys stored in memory) for which confidentiality must be maintained from attackers in peer or lower privilege levels. One example of such a vulnerability is the so-called spectre vulnerability. Another example is the so-called meltdown vulnerability, which especially affects Intel x86 microprocessors, IBM POWER processors, and some ARM-based microprocessors. (Intel, IBM and ARM are trademarks of their respective companies.)
It would be desirable to provide mitigations to address these or other issues.
In one aspect, a method is provided for use by a computing system equipped to access device memory (sometimes called non-speculative or unspeculatable memory) and non-device memory (sometimes called speculative or speculatable memory). The method includes: identifying sensitive information to protect; designating a portion of non-device memory as device memory; and storing the sensitive information in the portion of non-device memory designated as device memory.
In another aspect, a computing system includes: a memory including a portion that is non-device memory; and a processor configured to identify sensitive information to protect, designate a portion of the non-device memory as device memory, and store the sensitive information in the portion of non-device memory designated as device memory.
In yet another aspect, an apparatus comprises: means for identifying sensitive information to protect; means for designating a portion of non-device memory as device memory; and means for storing the sensitive information in the portion of non-device memory designated as device memory.
In still yet another aspect, a non-transitory machine-readable storage medium for use with a computing system is provided, the machine-readable storage medium having one or more instructions which when executed by at least one processing circuit of the computing system causes the at least one processing circuit to: identify sensitive information to protect; designate a portion of non-device memory as device memory; and store the sensitive information in the portion of non-device memory designated as device memory.
In the following description, specific details are given to provide a thorough understanding of the various aspects of the disclosure. However, it will be understood by one of ordinary skill in the art that the aspects may be practiced without these specific details. For example, circuits may be shown in block diagrams in order to avoid obscuring the aspects in unnecessary detail. In other instances, well-known circuits, structures and techniques may not be shown in detail in order not to obscure the aspects of the disclosure.
The word “exemplary” is used herein to mean “serving as an example, instance, or illustration.” Any implementation or aspect described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects of the disclosure. Likewise, the term “aspects” does not require that all aspects of the disclosure include the discussed feature, advantage or mode of operation.
Several features pertain to methods and apparatus for use with computing systems equipped perform speculative processing and configured to access device memory (sometimes called non-speculative, nonspeculatable, or unspeculatable memory, e.g. memory that speculative processing components are blocked from accessing) and non-device memory (sometimes called speculative or speculatable memory, e.g. memory that speculative processing components are not blocked from accessing). In several of the examples described herein, the computing system includes a processing system equipped for speculative processing. In some examples, the device memory (e.g. the non-speculative or unspeculatable memory) is associated with an external peripheral device. Speculative processing is not permitted using that memory since it affects a peripheral device. However, the non-device memory of the system can be used by the processor for speculative processing. As noted above, problems can arise in such systems as a result of malicious attacks that seek to obtain sensitive or secure information by exploiting the speculative execution. Attackers using software running in a low privilege mode can induce the processor to follow speculative processing paths or branches in a higher privileged mode that accesses sensitive memory. Even if the processor subsequently flushes the results of the speculative processing, the attacker may exploit side-channel analysis to reveal bits stored in the sensitive memory to thereby reveal cryptographic keys or the like. In this regard, at least some processors have been designed under the assumption that the results of speculative processing will not be vulnerable to attackers so long as the results are flushed. An attacker can exploit the vulnerability unless steps are takes to mitigate or eliminated the vulnerability.
Still further, modern central processing units (CPUs) are often configured to explicitly designate portions of memory as “device memory,” while other portions might be regarded as “non-device memory.” Within such CPUs, speculative processing is blocked from accessing device memory (e.g. non-speculative/unspeculatable/non-speculatable memory) since access based on incorrect speculation may adversely impact data stored in an external device (even if those speculative results are later flushed by the processor). And so the processor simply delays issuing loads or stores to “device memory” whenever a branch is speculatively reached that would access device memory until that branch's direction is resolved non-speculatively. This prevents any such adverse effects since the processor is forbidden to speculatively access device memory. Speculative processing is instead restricted to accessing only non-device memory (e.g. only speculative/speculatable memory), which may include SRAM formed on a System-on-a-Chip (SoC) device that includes the processor, but may also include external dynamic RAM (DRAM) that is off-chip.
Herein, techniques are described whereby sensitive data is protected from the aforementioned attacks by placing the sensitive data in a page of memory that is not ordinarily used as device memory (such as a page of SRAM on a secure SoC), but then designating the page as device memory. By designating the page as device memory, the processor then does not speculatively access the sensitive information (e.g. speculation stops once a branch is invoked that would access the page) and so the types of attacks described above are mitigated.
As shown in
Implementation details may vary from platform to platform, or from operating system (OS) to operating system (OS). By way of example, the OS may be equipped with tools for managing the device-marked memory and for advertising or exposing that memory to software applications. In some examples (described below), an application programming implementation (API) is provided to advertise and make available the pages or regions of device-marked memory to software applications. The software then accesses the device-marked memory via the API. Sensitive information to be protected may be so designated by software or by the OS and then stored in particular pages of device-marked memory (or in pools of pages of memory) so that secure and supervised software applications can conveniently access the sensitive information. Also, note that practical devices (and their associated memory) can be “off-chip” (e.g. servers where PCI cards are attached that include device memory) or “on-chip” (e.g. SOC devices where a Graphics or Audio IP is accessed through device memory). Normal memory is often stored off-chip (typically in DRAM) but can also be on-chip in a SRAM in some instances. This “normal” memory can be partitioned using the techniques described herein into two parts, a “protected section” that is treated as device memory (and hence unspeculatable) and a remaining section that is be treated as normal (e.g. speculatable).
In one particular example, the system of
Particular examples of “device memory” are ARM V7 “Device” and “Strongly Ordered” memory types, ARM V8 “ignore,” and “nGnRnE.” It is noted that “ARM” is a trademark of ARM Holdings or its affiliates. Within ARM v8, nGnRnE is the most restrictive memory type, as it is nG (non-gathering), nR (non-reordering) and nE (non-early write acknowledgement). Gathering or non-gathering relates to whether multiple accesses can be merged into a single transaction for this memory region. In particular, if an address is marked as non-Gathering (nG), then the number and size of accesses performed to that location must exactly match the number and size of explicit accesses in the code. If an address is marked as Gathering (G), the processor can, for example, merge two byte writes into a single halfword write. Reordering (R or nR) relates to whether accesses to the same device can be reordered with respect to each other. For example, if the address is marked as nR, then accesses within the same block always appear on the bus in program order. If the size of the block is large, it might span several table entries. In this case, the ordering rule is observed with respect to any other accesses also marked as nR. Early Write Acknowledgement (E or nE) relates to whether an intermediate write buffer between the processor and the device (being accessed) is allowed to send an acknowledgement of a write completion. For example, if an address is marked as non-nE, then the write response must come from the peripheral. If the address is marked as E, then a buffer in the interconnect logic can signal write acceptance, before the write is actually received by an end device. This is essentially a message to the external memory system.
Beginning at 208, the processor 202 marks selected pages or regions of non-device memory component 206 as device memory (e.g. non-speculative/unspeculatable memory). These pages or regions may be referred to as “device”-marked pages or regions. At 210, the processor 202 identifies sensitive information to be protected from speculative access (by potentially malicious software). The sensitive information may include passwords or the like. At 212, the processor 202 stores the sensitive information in the device-marked portions of non-device memory component 206 and later retrieves the information as needed. At 214, the non-device memory 206 stores the sensitive information received from the processor 202 in the device-marked pages or regions of its memory space and later outputs the information to the processor 202, as needed.
At 216, the processor 202 stores speculative information in ordinary portions of the non-device memory component 206 (e.g. non-device-marked portions) during speculative processing and later retrieves the speculative information as needed. At 214, the non-device memory component 206 stores the speculative information and outputs the information to the processor 202 as needed, such when speculative processing results are to be committed to a non-speculative state. At 220, the processor 202 stores non-speculative and non-sensitive information in the device memory component 204 and later retrieves the information as needed. At 222, the device memory component 204 stores the non-speculative and non-sensitive information within its memory space and later outputs the information to the processor as needed.
Thus,
At 304, address space layout randomization may be applied by the CPU to the pages of non-device memory that have been designated as device memory. With address space layout randomization, the pages are mapped to random virtual addresses on every boot so that attackers cannot easily target the pages with statically generated malware.
At 306, encrypted, authenticated, anti-replay protection is applied by the CPU to the page of non-device memory that has been designated as device memory (especially if the page is off-chip DRAM). This protection may be applied, for example, by a DRAM controller. And so, in examples where the sensitive data is to be stored off-chip in a DRAM (rather than using an on-chip SRAM), additional mitigations are employed.
At 308, address space un-mapping is applied by the CPU to the page of non-device memory that has been designated as device memory. With address space un-mapping, pages containing sensitive information are only mapped briefly when access is needed. Otherwise, those pages are un-mapped and hence cannot be easily accessed by malware or by speculative branches of privileged processes.
At 310, guard pages are applied by the CPU around the page of non-device memory that has been designated as device memory. With guard pages, pages containing sensitive information are bracketed in memory by pages that contain no information accessed by the processor. If an attack seeks to trick the processor into an overflow that spills from one page to the next, the attack would then not access any sensitive data.
It should be understood that the operations of blocks 304-310 may be applied, or not applied, separately. Moreover, the operations may be performed in a different order than as shown, or concurrently, or some of the operations may be performed concurrently along with others, while other operations are performed sequentially. Depending upon the particular mitigations, some should be performed before others. For example, address space layout randomization is usually applied when a computer is booted up, and hence this particular operation may be performed before all other listed mitigations and before any speculative processing begins. Those skilled in the art will understand when and how the various mitigations of
In some examples, software interfaces are used to facilitate or perform the security features described above. Illustrative embodiments will now be described. In a first example, an operating system (OS), hypervisor or other supervisory system includes software or firmware that for security purposes maintains a pool of device-marked memory pages and advertises and makes available the pages through paged memory management mechanisms to supervised software (such as applications, virtual machine (VM) guests, etc.). Since the pages of memory are marked as “device,” the pages are thus “non-speculative” (e.g. unspeculatable) and sensitive information may be stored therein. In a second example, the operating system, hypervisor or other supervisory system includes software or firmware that maintains a region of device-marked non-speculative/unspeculatable memory, which the software or firmware makes available to supervised software via an application programming interface API (such as a keystore, password manager, data vault, etc.)
Aspects of the systems and methods described herein can be exploited using a wide variety of computing systems and for a wide range of applications, including mobile devices, servers, etc. To provide a concrete example of a computing system, an exemplary system will now be described that uses a RISC-based CPU.
Briefly, computing system or device 800 includes a host platform 802 provided with a motherboard 804 that includes, among various other components, a RISC CPU 805 and an application digital signal processor (ADSP) and/or graphics processing unit (GPU) 807. The RISC CPU 805 includes a memory type designation controller 809, a sensitive information storage controller 811, and a speculative processing controller 813. In this example, the memory type designation controller 809 operates to designate pages or regions 808 within a DDR memory 810 as device memory. The sensitive information storage controller 811 operates to store sensitive information within the pages or regions 808 of the DDR memory 810 that have been designated as device memory to prevent any speculative access to the sensitive information. Note that the CPU 805 and the ADSP 807, along with other components, may be implemented as a System-on-a-Chip (SoC), which may include other devices or components as well. An exemplary SoC is described below.
Various other exemplary components and features of system 800 are also shown in
As noted, features described herein may be implemented in devices incorporating a SoC. To provide a concrete example, an exemplary SoC hardware environment will now be described.
In the example of
In one aspect, the components 910, 918, 920, 928, 930 and 950 of the SoC 902 are integrated on a single-chip substrate. The system further includes various external shared HW resources 940, which may be located on a different chip substrate and may communicate with the SoC 902 via one or more buses. External shared HW resources 940 may include, for example, an external shared storage 942 (e.g. double-data rate (DDR) dynamic RAM) and/or permanent or semi-permanent data storage 944 (e.g., a secure digital (SD) card, hard disk drive (HDD), an embedded multimedia card, a universal flash device (UFS), etc.), which may be shared by the application processing circuit 910 and the various peripheral subsystems 920 to store various types of data, such as an operating system (OS) information, system files, programs, applications, user data, audio/video files, etc. When a device incorporating the SoC 902 is activated, the SoC 902 begins a system boot up process in which the application processing circuit 910 may access boot RAM or ROM 918 to retrieve boot instructions for the SoC processing circuit 902, including boot sequence instructions for the various peripheral subsystems 920. The peripheral subsystems 920 may also have additional peripheral boot RAM or ROM 928. As already explained, in some examples, sensitive data may be stored off chip, such as in DDR RAM 942, within portions of memory therein designated or marked as “device memory” and with suitable additional protections, such as encryption.
In the example of
The processing circuit 1004 is responsible for managing the bus 1002 and for general processing, including the execution of software stored on the machine-readable medium 1006. The software, when executed by processing circuit 1004, causes processing system 1014 to perform the various functions described herein for any particular apparatus. Machine-readable medium 1006 may also be used for storing data that is manipulated by processing circuit 1004 when executing software.
One or more processing circuits 1004 in the processing system may execute software or software components. Software shall be construed broadly to mean instructions, instruction sets, code, code segments, program code, programs, subprograms, software modules, applications, software applications, software packages, routines, subroutines, objects, executables, threads of execution, procedures, functions, etc., whether referred to as software, firmware, middleware, microcode, hardware description language, or otherwise. A processing circuit may perform the tasks. A code segment may represent a procedure, a function, a subprogram, a program, a routine, a subroutine, a module, a software package, a class, or any combination of instructions, data structures, or program statements. A code segment may be coupled to another code segment or a hardware circuit by passing and/or receiving information, data, arguments, parameters, or memory or storage contents. Information, arguments, parameters, data, etc. may be passed, forwarded, or transmitted via any suitable means including memory sharing, message passing, token passing, network transmission, etc.
The software may reside on machine-readable medium 1006. The machine-readable medium 1006 may be a non-transitory machine-readable medium or computer-readable medium. A non-transitory processing circuit-readable, machine-readable or computer-readable medium includes, by way of example, a magnetic storage device (e.g., hard disk, floppy disk, magnetic strip), an optical disk (e.g., a compact disc (CD) or a digital versatile disc (DVD)), a smart card, a flash memory device (e.g., a card, a stick, or a key drive), RAM, ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), a register, a removable disk, a hard disk, a CD-ROM and any other suitable medium for storing software and/or instructions that may be accessed and read by a machine or computer. The terms “machine-readable medium”, “computer-readable medium”, “processing circuit-readable medium” and/or “processor-readable medium” may include, but are not limited to, non-transitory media such as portable or fixed storage devices, optical storage devices, and various other media capable of storing, containing or carrying instruction(s) and/or data. Thus, the various methods described herein may be fully or partially implemented by instructions and/or data that may be stored in a “machine-readable medium,” “computer-readable medium,” “processing circuit-readable medium” and/or “processor-readable medium” and executed by one or more processing circuits, machines and/or devices. The machine-readable medium may also include, by way of example, a carrier wave, a transmission line, and any other suitable medium for transmitting software and/or instructions that may be accessed and read by a computer.
The machine-readable medium 1006 may reside in the processing system 1014, external to the processing system 1014, or distributed across multiple entities including the processing system 1014. The machine-readable medium 1006 may be embodied in a computer program product. By way of example, a computer program product may include a machine-readable medium in packaging materials. Those skilled in the art will recognize how best to implement the described functionality presented throughout this disclosure depending on the particular application and the overall design constraints imposed on the overall system.
The various illustrative logical blocks, modules, circuits, elements, and/or components described in connection with the examples disclosed herein may be implemented or performed with a general purpose processing circuit, a DSP, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic component, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processing circuit may be a microprocessing circuit, but in the alternative, the processing circuit may be any conventional processing circuit, controller, microcontroller, or state machine. A processing circuit may also be implemented as a combination of computing components, e.g., a combination of a DSP and a microprocessing circuit, a number of microprocessing circuits, one or more microprocessing circuits in conjunction with a DSP core, or any other such configuration.
Hence, in one aspect of the disclosure, processing circuit 1004 illustrated in
Additionally, the processor 1302 of
It should be understood that the components of
In at least some examples, means may be provided for performing the functions illustrated in
In at least some examples, a machine-readable storage medium may be provided having one or more instructions which when executed by a processing circuit causes the processing circuit to performing the functions illustrated in
It should be understood that the operations of blocks 1408-1420 may be applied, or not applied, separately. Moreover, the operations may be performed in a different order than as shown, or concurrently, or some of the operations may be performed concurrently along with others, while other operations are performed sequentially. As noted above, address space layout randomization is applied when a computer is booted up, and hence address space layout randomization may be performed first, before all other operations in
Note that, herein, the terms “obtain” or “obtaining” broadly cover, e.g., calculating, computing, generating, acquiring, receiving, retrieving, inputting or performing any other suitable corresponding actions. Note also that aspects of the present disclosure may be described herein as a process that is depicted as a flowchart, a flow diagram, a structure diagram, or a block diagram. Although a flowchart may describe the operations as a sequential process, many of the operations can be performed in parallel or concurrently. In addition, the order of the operations may be re-arranged. A process is terminated when its operations are completed. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc. When a process corresponds to a function, its termination corresponds to a return of the function to the calling function or the main function.
Those of skill in the art would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the aspects disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system.
The methods or algorithms described in connection with the examples disclosed herein may be embodied directly in hardware, in a software module executable by a processor, or in a combination of both, in the form of processing unit, programming instructions, or other directions, and may be contained in a single device or distributed across multiple devices. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. A storage medium may be coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor.
The various features of the invention described herein can be implemented in different systems without departing from the invention. It should be noted that the foregoing embodiments are merely examples and are not to be construed as limiting the invention. The description of the embodiments is intended to be illustrative, and not to limit the scope of the claims. As such, the present teachings can be readily applied to other types of apparatuses and many alternatives, modifications, and variations will be apparent to those skilled in the art.
Moreover, in the following description and claims the terms “coupled” and “connected,” along with their derivatives, may be used. It should be understood that these terms are not intended as synonyms for each other. Rather, in particular aspects, “connected” may be used to indicate that two or more elements are in direct physical or electrical contact with each other. “Coupled” may mean that two or more elements are in direct physical or electrical contact. However, “coupled” may also mean that two or more elements are not in direct contact with each other, but yet still co-operate or interact with each other.
An aspect is an implementation or example. Reference in the specification to “an aspect,” “one aspect,” “some aspects,” “various aspects,” or “other aspects” means that a particular feature, structure, or characteristic described in connection with the aspects is included in at least some aspects, but not necessarily all aspects, of the present techniques. The various appearances of “an aspect,” “one aspect,” or “some aspects” are not necessarily all referring to the same aspects. Elements or aspects from an aspect can be combined with elements or aspects of another aspect.
Not all components, features, structures, characteristics, etc. described and illustrated herein need be included in a particular aspect or aspects. If the specification states a component, feature, structure, or characteristic “may,” “might,” “can” or “could” be included, that particular component, feature, structure, or characteristic is not required to be included. If the specification or claim refers to “a” or “an” element, that does not mean there is only one of the element. If the specification or claims refer to “an additional” element, that does not preclude there being more than one of the additional element.
In each figure, the elements in some cases may each have a same reference number or a different reference number to suggest that the elements represented could be different and/or similar. However, an element may be flexible enough to have different implementations and work with some or all of the systems shown or described herein. The various elements shown in the figures may be the same or different. Which one is referred to as a first element and which is called a second element is arbitrary.
One or more of the components, steps, features, and/or functions illustrated in the figures may be rearranged and/or combined into a single component, block, feature or function or embodied in several components, steps, or functions. Additional elements, components, steps, and/or functions may also be added without departing from the disclosure. The apparatus, devices, and/or components illustrated in the Figures may be configured to perform one or more of the methods, features, or steps described in the Figures. The algorithms described herein may also be efficiently implemented in software and/or embedded in hardware.
It is to be noted that, although some aspects have been described in reference to particular implementations, other implementations are possible according to some aspects. Additionally, the arrangement and/or order of circuit elements or other features illustrated in the drawings and/or described herein need not be arranged as illustrated and described. Many other arrangements are possible according to some aspects.
The present Application for Patent claims priority to Provisional Application No. 62/551,744 entitled “SECURITY AWARE NON-SPECULATIVE MEMORY” filed Aug. 29, 2017, which is assigned to the assignee hereof and hereby expressly incorporated by reference herein.
Number | Date | Country | |
---|---|---|---|
62551744 | Aug 2017 | US |