Boot firmware sandboxing
By sandboxing the option ROM firmware, the potential threat of malicious firmware during the boot sequence of the computing device is solved, improving the security of the computing device and avoiding the burden on the user experience.
Patent Information
- Application Number
- CN201980061975.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-16
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2039-09-16
AI Technical Summary
Malicious actors can compromise the system during the boot sequence of a computing device through malicious firmware. Existing technologies are difficult to effectively prevent such damage, and the user experience is affected.
Prevent malicious firmware from harming computing devices during boot by sandboxing option ROM firmware to limit its execution permissions and memory access scope. Sandboxing includes limiting the firmware's execution mode and memory access to prevent improper interaction with the boot loader.
It effectively prevents malicious firmware from harming computing devices during boot, reduces the potential threat of malicious behavior to the system, and does not require users to perform special actions or affect the user experience.
Smart Images

Figure CN112740211B_ABST
Abstract
Description
Background Art Technical Field
[0002] The present disclosure relates generally to computer systems, and more particularly to system booting.
[0003] Related technical description
[0004] When a computer system is powered on, it typically performs a boot sequence that includes executing a boot loader to ultimately load an operating system. Before loading the operating system, the boot loader may initially perform a set of power-on self-tests to verify the system hardware. The boot loader may also initiate the execution of firmware to initialize the system hardware. In some cases, the firmware may be installed by the manufacturer of the device during manufacturing. In other cases, the firmware may be loaded from a read-only memory (ROM) provided by the hardware, which may be installed in the system after manufacturing. This type of firmware may be referred to as option ROM (OROM) firmware and is used to initialize hardware such as graphics cards, small computer system interface (SCSI) devices, and the like. BRIEF DESCRIPTION OF THE DRAWINGS
[0005] Figure 1 is a block diagram illustrating an example of a computing device that implements a sandbox for firmware in an option ROM.
[0006] Figure 2 is a block diagram illustrating an example of a sandbox that restricts memory access.
[0007] Figure 3A is a block diagram illustrating an example of a sandbox that limits interaction with a boot loader.
[0008] Figure 3B is a block diagram illustrating an example of a sandbox that facilitates interaction between a graphics driver and a graphics card.
[0009] FIG. 4A to FIG. 4C is a flow chart illustrating an example of a method for sandboxing.
[0010] Figure 5 is a block diagram illustrating an exemplary computing device.
[0011] This disclosure includes references to "one embodiment" or "an embodiment." The appearance of the phrase "in one embodiment" or "in an embodiment" does not necessarily refer to the same embodiment. The particular features, structures, or characteristics may be combined in any suitable manner consistent with the present disclosure.
[0012] Within the present disclosure, different entities (which may be variously referred to as "units," "circuits," other components, etc.) may be described or claimed as being "configured to" perform one or more tasks or operations. This expression—[an entity] configured to [perform one or more tasks]—is used herein to refer to a structure (i.e., a physical thing, such as an electronic circuit). More specifically, this expression is used to indicate that this structure is arranged to perform one or more tasks during operation. A structure may be said to be "configured to" perform a task even if the structure is not currently being operated. "A graphics card configured to render content on a display" is intended to cover, for example, a card having circuits that perform that function during operation, even if the integrated circuit in question is not currently in use (e.g., a power source is not connected to it). Thus, an entity described or stated as "configured to" perform a task refers to a physical thing, such as a device, a circuit, a memory storing executable program instructions, etc., for implementing the task. The phrase is not used herein to refer to an intangible thing. Thus, a "configured to" structure is not used herein to refer to a software entity, such as an application programming interface (API).
[0013] The term “configured to” is not intended to mean “configurable to.” For example, an unprogrammed FPGA would not be considered “configured to” perform a particular function, although it may be “capable of being configured to” perform that function and may be “configured to” perform that function after being programmed.
[0014] The recitation of a structure in the appended claims as "configured to" perform one or more tasks is expressly intended to define the claim element. No Invoking 35 USC §112(f). Thus, no claim in this application as filed is intended to be construed as having means-plus-function elements. If the applicant wishes to invoke section 112(f) during the prosecution of the application, it will use the “means for [performing the function]” construction to phrase the claim elements.
[0015] As used herein, the terms "first," "second," and the like serve as labels for the nouns that follow them and do not imply any type of ordering (e.g., spatial, temporal, logical, etc.) unless explicitly stated. For example, a mobile device may have a first user and a second user. The term "first" is not limited to the initial user of the device. The term "first" may also be used when there is only one user of the mobile device.
[0016] As used herein, the term "based on" is used to describe one or more factors that influence a determination. The term does not exclude that there may be additional factors that may influence the determination. That is, the determination may be based only on the specified factors or on the specified factors and other unspecified factors. Consider the phrase "determining A based on B." This phrase specifies that B is a factor used to determine A or that B influences the determination of A. This phrase does not exclude that the determination of A may also be based on some other factor such as C. The phrase is also intended to cover embodiments in which A is determined based only on B. As used herein, the phrase "based on" is therefore synonymous with the phrase "based at least in part on." DETAILED DESCRIPTION
[0017] In some cases, a malicious actor may attempt to compromise a computing device during its boot sequence by causing the device to execute malicious OROM firmware. For example, malicious firmware may be installed in the OROM of a dongle that is inserted into the computing device prior to booting. When the computing device is initialized, the boot loader may retrieve the malicious firmware from the OROM of the dongle and be compromised when it attempts to execute the firmware. To prevent such exploits, the computing device may disable execution of the OROM firmware; however, this may not be possible with certain required hardware. Alternatively, the computing device may require the user to perform a specific action (e.g., pressing a specific sequence of characters on a keyboard) to authorize execution of the OROM firmware; however, this may place an undue burden on the user and disrupt the user experience. Furthermore, a malicious actor with access to the computing device may still potentially perform certain actions.
[0018] The present disclosure describes embodiments in which OROM firmware is sandboxed to prevent it from potentially harming a computing device during boot. As will be described in more detail below in various embodiments, a computing device may execute a boot loader to execute a boot sequence to load an operating system. (As used herein, the term "boot loader" is intended to be broadly interpreted in accordance with its meaning as understood in the art, and may refer to program instructions executed during a first boot phase to initialize hardware (e.g., a first-level boot loader from a UEFI boot ROM) and / or program instructions executed during a second boot phase to load an operating system (e.g., a second-level boot loader loaded from main storage). If the boot loader detects a peripheral device with firmware to be executed in the boot sequence to initialize the peripheral device, the boot loader may implement a sandbox to limit the execution of the firmware. In some embodiments described below, the sandbox may limit the address range of memory accessible to the firmware, such as preventing the firmware from accessing a range of memory used by the boot loader. In some In an embodiment, the sandbox also causes the firmware to execute in a restricted execution mode (e.g., x86 ring 3), where the firmware executes with restricted permissions relative to those permissions provided to the boot loader, which executes in an unrestricted mode (e.g., x86 ring 0). In some embodiments, the sandbox also limits how the firmware interacts with the boot loader, including limiting the requests that the firmware can make to the boot loader. For example, if the firmware requests an inappropriate action to be performed using a particular protocol, the request can be denied and the execution of the firmware can be paused / terminated. In many cases, sandboxed firmware executed during boot can significantly reduce the likelihood that malicious firmware can harm a computing device. Sandboxed firmware also does not require the user to perform some special actions or the firmware provider to implement some functions.
[0019] Now turn to Figure 1 , a block diagram of a computing device 100 is shown. In the illustrated embodiment, the device 100 includes a central processing unit (CPU) 110, a memory 120, and a peripheral device 130 coupled together via an interconnect 140. The memory 120 includes an operating system (OS) 122, a boot loader 124, and a sandbox 126. The peripheral device 130 includes an option read-only memory (OROM) 132, which includes firmware 134. In some embodiments, the computing device 100 may be specifically implemented differently than shown. For example, the peripheral device 130 may be one of a plurality of devices 130, the elements 122-126 may be located in a separate memory, and the computing device 100 may include the following with respect to Figure 5 Any of the additional components discussed, and so on.
[0020] In various embodiments, the boot loader 124 may be executable to boot the computing device 100, including loading the OS 122. Thus, when the computing device 100 is powered on, the device 100 may initiate execution of the boot loader 124 to perform a boot sequence for the computing device 100. The boot sequence may include the boot loader 124 initially performing various power-on self tests (POST). The boot loader 124 may attempt to initialize various hardware, such as the peripherals 130 described below. The boot loader 124 may then complete the boot sequence with the loading of the kernel of the OS 122. In some embodiments, the boot loader 124 may conform to a specification such as a basic input / output system (BIOS), a unified extensible firmware interface (UEFI), or the like.
[0021] In various embodiments, peripheral device 130 is a hardware device that is initialized during a boot sequence executed by boot loader 124. Peripheral device 130 may correspond to any suitable hardware, such as a graphics card, a sound card, a network interface card (NIC) (e.g., a Wi-Fi TM , cellular), storage devices, keyboards, mice, displays, joysticks, biometric sensors (e.g., fingerprint sensors, retinal sensors, facial recognition sensors), cameras (e.g., visible light or infrared light), vehicle navigation systems (or other electronic control units (ECUs) in vehicles), light detection and ranging (LIDAR) transmitters and receivers, neural network engines, accelerometers, eye tracking sensors, hand tracking sensors, global positioning system (GPS) sensors, etc. In some embodiments, device 130 is a card that is configured to be inserted internally into computing device 100 and coupled via an interconnect that can support, for example, rapid interconnection of peripheral components In some embodiments, device 130 is accessible via a universal serial bus TM (USB), Thunderbolt TM Equally coupled external devices.
[0022] In various embodiments, the bootloader 124 may not have sufficient capabilities to initialize the peripheral devices 130 and may therefore rely on the firmware 134 provided by the OROM 132 to initialize the devices 130. Although the term "option ROM" refers to read-only memory, the term "option ROM" as used herein should not be limited to read-only memory; rather, the term may refer to other forms of non-volatile memory, such as NAND flash memory, NOR flash memory, nano RAM (NRAM), or hereinafter referred to as Figure 5In some embodiments, firmware 134 may reside in a memory separate from peripheral device 130. In various embodiments, firmware 134 includes one or more drivers executable to enable use of peripheral device 130. For example, if peripheral device 130 is a graphics card, firmware 134 may include a display driver executable to enable an application to request the graphics card to render content presented on a display of device 100. However, as described above, execution of firmware 134 may allow a malicious actor to inject program instructions that could harm device 100.
[0023] However, in various embodiments, the boot loader 124 may be executable to instantiate the sandbox 126 to isolate the firmware 134. Figure 2 As discussed, in some embodiments, the sandbox 126 limits which memory addresses the firmware 134 can access. Specifically, the boot loader 124 may allocate one or more address ranges of the memory 120 (which may be allocated in the form of pages) to the firmware 134, and the sandbox 126 may limit the firmware 134 to access only addresses within the allocated ranges. Thus, if the firmware 134 attempts to access an address outside its allocated range, the sandbox 126 may block the access and, in some embodiments, stop the firmware 134 / terminate the execution of the firmware 134. In some embodiments, one or more address ranges are allocated to the firmware 134 for memory-mapped input / output (MMIO) operations relative to the peripheral device 130, but the sandbox 126 may prevent the firmware 134 from accessing MMIO address ranges corresponding to other devices. Similarly, in some embodiments, the sandbox 126 may allow the peripheral device 130 to access a memory address range allocated to the firmware 134 via a direct memory access (DMA) operation, but prohibit the peripheral device 130 from accessing an address range outside the address range allocated to the firmware 134.
[0024] As will be described below with respect to Figure 3A and Figure 3BAs discussed, in some embodiments, the sandbox 126 also includes executing firmware 134 in application mode (or user mode). As used herein, the term "application mode" (or user mode) refers to an execution mode in which a processor such as CPU 110 executes an application (i.e., a process) with restricted permissions. For example, in an x86 processor, this mode is referred to as ring 3. In such a mode, a process may be prohibited from executing instructions defined by a specific instruction set architecture (ISA), such as writeback and invalid cache instructions of x86. The processor may also prevent direct access to specific hardware and / or restrict application access to "application space", which refers to a memory area allocated to an application executed in application mode. Exemplary applications executed in application mode may include, for example, a word processing application, a web browser, a mail client, or other user applications. For security reasons, most applications typically run as in application mode. In contrast, "kernel mode" (or system mode) refers to a mode in which a processor such as CPU 110 executes an application with unrestricted permissions. For example, in an x86 processor, this mode is referred to as ring 0. Kernel mode is typically used for applications responsible for system management, such as boot loaders (such as boot loader 124), operating system kernels, drivers, hypervisors, etc. The term "kernel space" refers to a restricted area of memory that is accessible only to applications executing in kernel mode - in some embodiments, kernel mode applications may also be restricted from accessing application space areas of memory.
[0025] Because the CPU 110 can execute the firmware 134 and the boot loader 124 in different modes (i.e., application mode and kernel mode, respectively) in various embodiments, the sandbox 126 facilitates communication between the firmware 134 and the boot loader 124, but limits what the communication can do and how it can occur. Figure 3AAs described, the boot loader 124 may support multiple protocols for transmitting specific types of information (e.g., thirty different protocols), but the sandbox 126 may allow the firmware 134 to install and use only a small subset of the protocols (e.g., ten protocols). Further, because the firmware 134 may not be allowed to access kernel space and thus perform a call into the boot loader 124 to cause it to perform the requested operation, the firmware 134 may instead perform a call into a wrapper of the sandbox 126, which performs a downcall (also known as a system call) to cause the CPU 110 to execute the boot loader 124 in kernel mode. Similarly, the boot loader 124 may not be allowed to access application space and thus perform a call back into the firmware 134 to cause it to perform the requested operation; instead, in some embodiments, the boot loader 124 performs a call into the sandbox 126, which performs an upcall (also known as a system return / exit) to cause the CPU 110 to execute the firmware 134. Additionally, in some embodiments, the sandbox 126 clones data passed from application space to kernel space or from kernel space to application space when a downcall or upcall occurs.
[0026] Now turn to Figure 2 , shows a block diagram of memory address sandboxing 200. As described above, in some embodiments, the sandbox 126 may restrict which memory addresses the firmware 134 may access, such as those associated with the memory 120 and MMIO of various hardware devices.
[0027] When execution of firmware 134 is initiated, in the illustrated embodiment, boot loader 124 allocates one or more blocks / pages 210 of memory 120 for use by firmware 134. In various embodiments, sandbox 126 allows firmware 134 to perform memory accesses 212 (e.g., read or write) for address ranges corresponding to allocated pages 210, but prevents firmware 134 from performing memory accesses 212 for addresses belonging to other pages 210 that have not been allocated to firmware 134. Thus, if firmware 134 attempts to write to an address outside of its allocated page 210, it may be blocked from writing, and in some embodiments, may be terminated. In some embodiments, pages 210 are also virtual, meaning that they may be accessed by specifying virtual addresses that are translated into corresponding physical addresses of memory 120 using a page table. In such embodiments, entries in the page table may be marked to indicate whether a given virtual-to-physical address translation belongs to a page in application space (i.e., to a process executing in application mode, such as firmware 134) or to a page in kernel space (i.e., to a process executing in kernel mode, such as boot loader 124). Further, in some embodiments, the entry may be marked to indicate the associated process of a given page (e.g., by specifying a process identifier (PID) associated with the page). In some embodiments, the sandbox 126 may use these page table indications to restrict firmware 134 access to addresses in memory 120. As an additional precaution, the boot loader 124 may also zero / clear memory for pages 210 allocated to firmware 134.
[0028] In various embodiments, computing device 100 is configured to support MMIO, in which one or more address ranges are mapped to registers for interacting with underlying hardware other than memory 120. For example, peripheral device 130 may include one or more physical registers that are used to exchange data with device 130 and are mapped to accessible addresses so that they appear as memory addresses to a process. In the illustrated embodiment, sandbox 126 allows firmware 134 to perform MMIO accesses (e.g., read or write operations) to addresses assigned to peripheral device 130 when they originate from device 130, but prevents firmware 134 from performing MMIO accesses 222 to address ranges associated with other hardware. Thus, if firmware 134 is a display driver and issues a request to access the MMIO address of a sound card, sandbox 126 may determine that firmware 134 is not associated with a sound card and block the request, and in some embodiments, terminate firmware 134.
[0029] In some embodiments, the sandbox 126 may similarly restrict the peripheral device 130 from accessing a particular address range. For example, in the illustrated embodiment, the peripheral device 130 is allowed to perform direct memory access (DMA) operations (e.g., reads and writes) relative to the address range of the allocated pages 210A, but the device 130 may be prevented from performing DMA operations relative to other pages allocated to other processes. Thus, for example, if the peripheral device 130 requests a DMA operation for a page associated with the boot loader 124, the DMA request may be denied. In some embodiments, the sandbox 126 may identify which pages 210 the peripheral device 130 may access via DMA based on the page table entries marked as described above.
[0030] Now turn to Figure 3A , which shows a block diagram of protocol sandboxing 300. As described above, in various embodiments, firmware 134 may be prevented from interacting directly with boot loader 124 because firmware 134 is not allowed to access kernel space. Therefore, in the illustrated embodiment, sandbox 126 facilitates communication between firmware 134 in application space 302 and boot loader 124 in kernel space 304 by using protocol 310 implemented by wrapper 320 and facilitator 330.
[0031] In various embodiments, the protocol 310 is used to facilitate communication between various elements (such as the boot loader 124 and the firmware 134) that participate in the boot sequence of the computing device 100. In general, a given protocol 310 may define one or more specific types of data to be transmitted, such as defining what the data is and how the data is structured. A given protocol 310 may also define how to transmit it, such as identifying specific addresses / pointers to write and read data. Examples of various protocols 310 may include protocols for requesting page allocations, setting UEFI variables, performing NVRAM writes, facilitating device interactions (such as storage media protocols, screen pull protocols, and reading and writing PCIe configurations), etc. In some embodiments, the protocol 310 implements a protocol that complies with UEFI.
[0032] As described above, to provide further security in some embodiments, the sandbox 126 may restrict what protocols 310 the firmware 134 may access. That is, the boot loader 124 may support multiple protocols 310, but the sandbox 126 may allow the firmware 134 to install and use only a subset of the protocols 310 that are relevant to the intended use of the device 130. For example, if the firmware 134 is a graphics driver, the sandbox 126 may prevent it from importing protocols related to network interface cards. In various embodiments, the sandbox 126 may include policies that it evaluates to determine which protocols 310 the firmware 134 should access and which protocols 310 should be prohibited. Further, when installing and using allowed protocols 310, the firmware 134 is not allowed to interact directly with processes associated with the kernel space 304, such as the boot loader 124.
[0033] Thus, in various embodiments, a downcall protocol 310A may be used to route communications from the firmware 134 indirectly into the kernel space 304—and, in some cases, onto the boot loader 124. For example, the firmware 134 may want to issue a request 312A to cause the boot loader 124 to perform operations such as allocating an additional page 210 in the memory 120, setting a UEFI variable, etc. Rather than executing a call directly into the boot loader 124 (which may include executing a call instruction or other control transfer instruction that incorrectly specifies the kernel space address of the boot loader 124), the firmware 134 makes the request 312A as a call into a downcall wrapper 320A that also resides in the application space 302 and is restricted by the sandbox 126. The downcall wrapper 320 may then set the opcode associated with the particular operation requested and call the included / packaged system call instruction (e.g., an x86 syscall or sysenter instruction) to perform a system call 322 into the kernel space 304, where the call is processed by the downcall facilitator 330A executing in kernel mode. In various embodiments, the downcall facilitator 330A initially analyzes the opcode (and / or any other parameters associated with the request 312A) to determine whether the operation requested by the firmware 134 is allowed. If the operation is allowed, the downcall facilitator 330A may clone / copy any required data from the application space 302 into the kernel space 304 and make a call 312B into the boot loader 124 (e.g., by executing a call instruction or other control transfer instruction) to cause the boot loader 124 to perform the requested operation.
[0034] Because the boot loader 124 may be prohibited from accessing the application space 302 in some embodiments, the upcall protocol 310B may indirectly route communications from the boot loader 124 (or other kernel space process) to the application space 302 where the firmware 134 is located. For example, the boot loader 124 may want to transmit a response to the request 312A or want the firmware 134 to cause the peripheral device 130 to perform a specific operation. Therefore, the boot loader 124 may issue a request 312C by executing the call instruction into the upcall wrapper 320B, which may include a system return instruction (e.g., an x86 sysret or sysexit instruction) that may be executed to perform a system return 324 back to the application 302. Before executing the system return instruction, the upcall wrapper 320B may clone any data associated with the request 312C from the kernel space 304 into the application space 302. When executing the system return instruction, CPU 110 may transition from executing wrapper 320A in kernel mode to executing helper 330B in application mode, where upcall helper 330B may process system return 324 and execute call 312D into firmware 134 to service the request from boot loader 124.
[0035] Now turn to Figure 3B, which shows a block diagram of a display example 350. In the illustrated embodiment, firmware 134 is a graphics driver that communicates with graphics card 130 via PCI protocol 310A. In example 350, boot loader 124 may want to make graphics card 130 render some display data 352 on the display of computing device 100, such as presenting a prompt to indicate that computing device 100 is currently booting and including a progress bar indicating that the computing device is in the position in its boot sequence. As shown, boot loader 124 can propose request 312E as a call to the up call wrapper 320B of graphics output protocol 310B. Up call wrapper 320B can then call system exit 324 into the corresponding up call helper 330B of protocol 310B, which can call the corresponding call 312F into graphics driver 134. Graphics driver 134 can then try to service the request by making a PCI call 312G in the down call wrapper 320A of PCI protocol 310A. The downcall wrapper 320A may then call a system call 322 to cause the CPU 110 to transition from executing the downcall wrapper 320A in application mode to executing the downcall facilitator 330A in kernel mode. The downcall facilitator 330A may then analyze the system call 322 to determine whether the request being made (e.g., to transfer data 352 to the card 130) is allowed, such as checking the opcode associated with the call, the source of the call (i.e., the call is from the driver 134 originating from the graphics card 130), etc. If the request made using the system call 322 is allowed, the facilitator 330A may then pass the display data 352 to the graphics card 130 residing in the hardware space 306. In response to receiving the data 352, the graphics card 130 may render a corresponding hint and output the hint to the display of the device 100.
[0036] In some embodiments, the display example 350 may be implemented differently than shown. For example, in one embodiment, the boot loader 124 may issue a request 312E to the upcall wrapper 320B, which may perform a system exit 324 to the upcall helper 330B, as described above. However, when the upcall helper 330B issues a driver call 312F to the graphics driver 134, the driver 134 may provide display data 352 directly to the graphics card 130 by writing the data 352 to the MMIO address range of the card 130, as described above with respect to FIG. Figure 2 In such embodiments, the driver 134's exchanges with the card 130 may be described as "side calls" because providing the data 352 does not require a system call back into kernel space 304.
[0037] Now turn to Figure 4A, which shows a flow chart of method 400. Method 400 is one embodiment of a method for securely executing boot firmware. In various embodiments, method 400 is performed by a computing device such as computing device 100 that executes a boot loader. In many cases, executing method 400 may make it more difficult to compromise the system during boot.
[0038] In step 405 , a boot loader (eg, boot loader 124 ) initiates a boot sequence to load an operating system (eg, operating system 122 ) of a computing device.
[0039] In step 410, the boot loader detects firmware (eg, firmware 134) of a peripheral device (eg, device 130) to be executed during the boot sequence to initialize the peripheral device for use by the computing device.
[0040] In step 415, in response to the detection, the boot loader instantiates a sandbox (e.g., sandbox 126) that isolates the firmware from the boot loader. In various embodiments, the firmware is loaded from an option read-only memory (OROM) (e.g., OROM 132) included in the peripheral device and is executed during the boot sequence to initialize the peripheral device. In some embodiments, the boot loader assigns one or more memory address ranges to the firmware, and the sandbox restricts the firmware from accessing memory addresses that are not included in the assigned one or more memory address ranges. In some embodiments, the boot loader assigns one or more pages of memory (e.g., page 210) to the firmware, and the one or more memory address ranges include a range corresponding to the one or more pages. In some embodiments, the assignment includes assigning a memory mapped input / output (MMIO) address range of the peripheral device to the firmware, and the restriction includes preventing the firmware from accessing the MMIO address of another peripheral device of the computing device. In some embodiments, the computing device services direct memory access (DMA) requests (e.g., for DMA operation 232) from addresses within the specified one or more address ranges of the peripheral device, and blocks direct memory access (DMA) requests from addresses outside the specified one or more address ranges of the peripheral device.
[0041] In some embodiments, the computing device executes a boot loader in kernel mode, in which the boot loader executes with a set of unrestricted permissions, and causes the firmware to execute in application mode, causing the firmware to execute with a set of restricted permissions. In some embodiments, the sandbox receives a request (e.g., request 312A) from the firmware to cause the boot loader to perform an operation, and in response to receiving the request, calls a system call (e.g., system call 322) to cause the processor of the computing device to switch to executing the boot loader in kernel mode. In such embodiments, the boot loader performs the operation in response to determining that the firmware request operation is allowed. In some embodiments, the sandbox receives a request (e.g., request 312C) from the boot loader to cause the firmware to perform an operation, and in response to receiving the request, calls a system return (e.g., system return 324) to cause the processor of the computing device to switch to executing the firmware in application mode. In some embodiments, the boot loader supports multiple unified extensible firmware interface (UEFI) protocols (e.g., protocol 310) that can be used to transmit data, and the sandbox restricts the firmware to use only a subset of the supported multiple UEFI protocols.
[0042] Now turn to Figure 4B , which shows a flow chart of method 430. Method 430 is another embodiment of a method for securely executing boot firmware. In various embodiments, method 430 is performed by a computing device such as computing device 100 that executes a boot loader. In many cases, executing method 430 may make it more difficult to compromise the system during boot.
[0043] In step 435 , a boot loader (eg, boot loader 124 ) performs a boot sequence to initialize an operating system (eg, operating system 122 ) of the computing device.
[0044] In step 440, the boot loader detects a device driver (eg, included in or corresponding to firmware 134) loaded into a memory (eg, OROM 132) of a peripheral device (eg, peripheral device 130) of the computing device during a boot sequence.
[0045] In step 445, the boot loader instantiates a sandbox (e.g., sandbox 126) to isolate the execution of the device driver from the execution of the boot loader. In some embodiments, instantiation includes causing the processor (e.g., CPU 110) of the computing device to execute the device driver in application mode, in which the device driver is executed with a set of restricted permissions. In some embodiments, the computing device receives a request (e.g., request 312A) from the device driver to perform an operation on the boot loader, and executes a system call instruction (e.g., system call 322) in response to the request to transition to kernel mode, in which the boot loader is executed with a set of unrestricted permissions. In some embodiments, instantiation includes allocating an address range of memory to the device driver (e.g., the address range of page 210A or device 130), and preventing the device driver from accessing addresses outside the allocated address range. In some embodiments, the allocated address range is a virtual memory address range. In such embodiments, the computer device receives a request from a device driver to access a virtual memory address within the assigned address range (eg, memory access 212 or MMIO access 222), and converts the virtual memory address to a physical memory address in a memory of the computing device.
[0046] Now turn to Figure 4C , which shows a flow chart of method 460. Method 460 is another embodiment of a method for securely executing boot firmware. In various embodiments, method 460 is performed by a computing device including a peripheral device (the peripheral device includes a memory in which firmware is stored) such as computing device 100 including peripheral device 130. In many cases, executing method 460 may make it more difficult to compromise the system during boot.
[0047] In step 465 , a boot loader (eg, boot loader 124 ) initiates a boot sequence to load an operating system (operating system 122 ) of the computing device.
[0048] The boot loader detects the peripheral device during the boot sequence in step 470. In some embodiments, the peripheral device is a graphics card configured to implement Peripheral Component Interconnect Express (PCIe), and the firmware is included in an option read only memory (OROM) of the graphics card.
[0049] In step 475, the boot loader implements a sandbox (e.g., sandbox 126) that limits the execution of the firmware in response to the detection. In some embodiments, the implementation includes limiting the execution of the firmware by assigning an address range of memory to the firmware (e.g., an address range corresponding to the assigned page 210 or an MMIO address range of the peripheral device 130), and determining that the firmware is attempting to access a memory address outside the assigned address range, and based on the determination, terminating the execution of the firmware. In some embodiments, the implementation includes receiving a request from the firmware to transfer data to the peripheral device (e.g., PCI call 312G), determining that the firmware originated from a memory in the peripheral device, and in response to the determination, transferring the data (e.g., display data 352) to the peripheral device. In some embodiments, the implementation includes causing the processor to execute a system call instruction (e.g., system call 322) in response to a request from the firmware to cause the boot loader to perform an operation (e.g., request 312A), and in response to executing the system call instruction, transitioning to kernel mode to evaluate whether the firmware request to perform the operation is allowed.
[0050] Exemplary Computer System
[0051] Now go to Figure 5 , which shows a block diagram describing an exemplary embodiment of a computing device 500 that can implement the functionality of computing device 100. Device 500 can correspond to any suitable computing device, such as a server system, a personal computer system, a desktop computer, a laptop or notebook computer, a mainframe computer system, a tablet computer, a handheld computer, a workstation, a network computer, a mobile phone, a music player, a personal data assistant (PDA), a wearable device, an Internet of Things (IoT) device, etc. In the illustrated embodiment, device 500 includes a structure 510, a processor complex 520, a graphics unit 530, a display unit 540, a cache / memory controller 550, and an input / output (I / O) bridge 560. In some embodiments, the elements of device 500 can be included in a system on a chip (SOC).
[0052] Structure 510 may include various interconnects, buses, MUXs, controllers, etc., and may be configured to facilitate communication between various elements of device 500. In some embodiments, portions of structure 510 may be configured to implement a variety of different communication protocols. In other embodiments, structure 510 may implement a single communication protocol, and elements coupled to structure 510 may be internally converted from the single communication protocol to other communication protocols. As used herein, the term "coupled to" may indicate one or more connections between elements, and a coupling may include intermediate elements. For example, in Figure 5In FIG, graphics unit 530 may be described as being "coupled to" memory via structure 510 and cache / memory controller 550. In contrast, in Figure 5 In the illustrated embodiment, graphics unit 530 is "directly coupled" to structure 510 because there are no intervening elements.
[0053] In the illustrated embodiment, processor complex 520 includes bus interface unit (BIU) 522, cache 524, and cores 526A and 526B. In various embodiments, processor complex 520 may include various numbers of processors, processor cores, and / or caches. For example, processor complex 520 may include 1, 2, or 4 processor cores, or any other suitable number. In one embodiment, cache 524 is a group associative L2 cache. In some embodiments, cores 526A and / or 526B may include internal instruction and / or data caches. In some embodiments, a consistency unit (not shown) in structure 510, cache 524, or elsewhere in device 500 may be configured to maintain consistency between the various caches of device 500. BIU 522 may be configured to manage communications between processor complex 520 and other elements of device 500. A processor core such as core 526 may be configured to execute instructions of a specific instruction set architecture (ISA), which may include operating system instructions and user application instructions. In some embodiments, complex 520 may implement CPU 110 discussed above. These instructions may be stored in a computer readable medium, such as a memory coupled to memory controller 550 discussed below.
[0054] Graphics unit 530 may include one or more processors and / or one or more graphics processing units (GPUs). For example, graphics unit 530 may receive graphics-oriented instructions such as Metal or Instructions. Graphics unit 530 may execute dedicated GPU instructions or perform other operations based on the received graphics-oriented instructions. Graphics unit 530 may generally be configured to process large blocks of data in parallel, and may build images in a frame buffer for output to a display. Graphics unit 530 may include transformation, lighting, triangle and / or rendering engines in one or more graphics processing pipelines. Graphics unit 530 may output pixel information for displaying an image. In some embodiments, graphics unit 530 may correspond to peripheral device 130.
[0055] The display unit 540 may be configured to read data from the frame buffer and provide a stream of pixel values for display. In some embodiments, the display unit 540 may be configured as a display pipeline. In addition, the display unit 540 may be configured to blend multiple frames to produce an output frame. In addition, the display unit 540 may include one or more interfaces (e.g., a touch screen or an external display) for coupling to a user display (e.g., or embedded DisplayPort (eDP).
[0056] The cache / memory controller 550 may be configured to manage data transfers between the structure 510 and one or more caches and / or memories. For example, the cache / memory controller 550 may be coupled to an L3 cache, which in turn may be coupled to a system memory. In other embodiments, the cache / memory controller 550 may be directly coupled to the memory. In some embodiments, the cache / memory controller 550 may include one or more internal caches. The memory coupled to the memory 550 may be any type of volatile memory, such as a dynamic random access memory (DRAM), a synchronous DRAM (SDRAM), a double data rate (DDR, DDR2, DDR3, etc.) SDRAM (including a mobile version of SDRAM, such as mDDR3, etc., or a low power version of SDRAM, such as LPDDR4, etc.), a RAMBUS DRAM (RDRAM), a static RAM (SRAM), etc. One or more memory devices may be coupled to a circuit board to form a memory module, such as a single inline memory module (SIMM), a dual inline memory module (DIMM), etc. Alternatively, the device may be mounted with integrated circuits in a chip-on-chip configuration, a package-on-package configuration, or a multi-chip module configuration. The memory coupled to the controller 550 may be any type of non-volatile memory, such as NAND flash memory, NOR flash memory, nano RAM (NRAM), magnetoresistive RAM (MRAM), phase change RAM (PRAM), racetrack memory, memristor memory, etc. As described above, the memory may store program instructions executable by the processor complex 520 to cause the device 500 to perform the functions described herein. In some embodiments, the memory may correspond to the memory 120 discussed above.
[0057] The I / O bridge 560 may include various elements configured to implement, for example, universal serial bus (USB) communications, security, audio, and / or low power always-on functionality. The I / O bridge 560 may also include interfaces such as pulse width modulation (PWM), general purpose input / output (GPIO), serial peripheral interface (SPI), and / or internal integrated circuit (I2C). Various types of peripherals and devices may be coupled to the device 500 via the I / O bridge 560. For example, these devices may include various types of wireless communications (e.g., wifi, Bluetooth, cellular, global positioning system, etc.), additional storage devices (e.g., RAM storage devices, solid-state storage devices, or disk storage devices), user interface devices (e.g., keyboards, microphones, speakers, etc.), etc.
[0058] ***
[0059] Although specific embodiments have been described above, these embodiments are not intended to limit the scope of the present disclosure, even when only a single embodiment is described with respect to specific features. The feature examples provided in this disclosure are intended to be illustrative, not limiting, unless otherwise stated. The above description is intended to cover such alternatives, modifications, and equivalents, which will be apparent to those skilled in the art who are aware of the effective effects of the present disclosure.
[0060] The scope of the present disclosure includes any feature or combination of features disclosed herein (explicitly or implicitly) or any generalization thereof, whether or not it mitigates any or all of the problems addressed herein. Accordingly, new claims may be made during the prosecution of this patent application (or a patent application claiming priority thereto) for any such combination of features. In particular, with reference to the appended claims, features of the dependent claims may be combined with features of the independent claims, and features from the corresponding independent claims may be combined in any appropriate manner and not just by the specific combinations listed in the appended claims.
Claims
1. A non-transitory computer-readable medium having program instructions stored therein, the program instructions being executable by a computing device to cause the computing device to perform operations comprising: Initiating a boot sequence by a boot loader to load an operating system of the computing device; detecting, by the boot loader, firmware of a peripheral device to be executed during execution of the boot sequence to initialize the peripheral device for use by the computing device; In response to the detecting, instantiating, by the boot loader, a sandbox isolating the firmware from the boot loader; At a wrapper of the sandbox, receiving a request from the firmware to cause the bootloader to perform an operation; In response to receiving the request, a system call is issued by the wrapper to cause the boot loader to perform the operation.
2. The computer-readable medium of claim 1, wherein the operations comprise: loading the firmware from an option read-only memory (OROM) included in the peripheral device; as well as The firmware is executed during execution of the boot sequence to initialize the peripheral devices.
3. The computer-readable medium of claim 1 , wherein the operations comprise: allocating, by the boot loader, one or more memory address ranges to the firmware; as well as The firmware is restricted, by the sandbox, from accessing memory addresses that are not included in the allocated one or more memory address ranges.
4. The computer-readable medium of claim 3, wherein the operations comprise: One or more pages of memory are allocated by the boot loader to the firmware, wherein the one or more memory address ranges include a range corresponding to the one or more pages.
5. The computer-readable medium of claim 3, wherein the allocating comprises allocating a memory-mapped input / output MMIO address range of the peripheral device to the firmware; and Wherein the restriction includes preventing the firmware from accessing an MMIO address of another peripheral device of the computing device.
6. The computer-readable medium of claim 1, wherein the operations comprise: allocating, by the boot loader, one or more memory address ranges to the firmware; servicing a direct memory access (DMA) request from the peripheral device specifying an address within the one or more memory address ranges; as well as DMA requests from the peripheral device that specify addresses outside of the one or more memory address ranges are blocked.
7. The computer-readable medium of claim 1, wherein the operations comprise: executing the boot loader in kernel mode, wherein the boot loader executes with an unrestricted set of permissions; and The instantiation includes causing the firmware to execute in an application mode, so that the firmware executes with a restricted set of permissions.
8. The computer-readable medium of claim 7, wherein the operations comprise: In response to determining that the firmware is allowed to request the operation, the operation is performed by the boot loader.
9. The computer-readable medium of claim 7, wherein the operations comprise: receiving, by a second wrapper of the sandbox, a request from the boot loader to cause the firmware to perform an operation; as well as In response to receiving the request, the second wrapper calls a system return to cause the processor of the computing device to transition to executing the firmware in the application mode.
10. The computer-readable medium of claim 1, wherein the boot loader supports a plurality of Unified Extensible Firmware Interface (UEFI) protocols that can be used to transfer data; and The operations include: The firmware is restricted by the sandbox to use only a subset of the supported UEFI protocols.
11. A method comprising: A boot sequence is executed by the boot loader to initialize the operating system of the computing device; During the boot sequence: detecting, by the boot loader, a device driver loaded into a memory of a peripheral device of the computing device; instantiating, by the boot loader, a sandbox to isolate execution of the device driver from execution of the boot loader; receiving, at a wrapper of the sandbox, a request from the device driver to cause the boot loader to perform an operation; as well as In response to the request, a system call is issued by the wrapper to cause the boot loader to perform the operation.
12. The method of claim 11, wherein the instantiating comprises causing a processor of the computing device to execute the device driver in an application mode, wherein the device driver executes with a restricted set of permissions.
13. The method according to claim 12, further comprising: In response to the request, the processor executes the system call to transition to kernel mode in which the boot loader executes with an unrestricted set of privileges.
14. The method of claim 11, wherein the instantiating comprises assigning an address range of memory to the device driver and preventing the device driver from accessing addresses outside the assigned address range.
15. The method of claim 14, wherein the allocated address range is a virtual memory address range, and wherein the method further comprises: receiving, by the computing device, a request from the device driver to access a virtual memory address within the assigned address range; as well as The virtual memory address is translated, by the computing device, into a physical memory address in a memory of the computing device.
16. A computing device comprising: a peripheral device, the peripheral device comprising a memory having firmware stored therein; processor; and a memory having program instructions stored therein, the program instructions being executable by the processor to cause the computing device to perform operations including: Initiating a boot sequence by a boot loader to load an operating system of the computing device; detecting, by the boot loader, the peripheral device during execution of the boot sequence; In response to the detecting, implementing, by the bootloader, a sandbox that restricts execution of the firmware; At a wrapper of the sandbox, receiving a request from the firmware to cause the bootloader to perform an operation; as well as In response to the request, a system call is issued by the wrapper to cause the boot loader to perform the operation.
17. The computing device of claim 16, wherein the implementing comprises limiting execution of the firmware by: assigning an address range of a memory to the firmware; determining that the firmware is attempting to access a memory address outside of an assigned address range; and Based on the determination, execution of the firmware is prohibited.
18. The computing device of claim 16, wherein the implementing comprises: receiving a request from the firmware to transfer data to the peripheral device; determining that the firmware originates from the memory in the peripheral device; as well as Responsive to the determination, the data is transmitted to the peripheral device.
19. The computing device of claim 16, wherein the implementing comprises: In response to the system call, a transition is made to kernel mode to evaluate whether the firmware is permitted to request to perform the operation.
20. The computing device of claim 16, wherein the peripheral device is a graphics card configured to implement Peripheral Component Interconnect Express (PCIe), and wherein the firmware is included in an option read-only memory (ORM) of the graphics card.
Citation Information
Patent Citations
Method for firmware isolation
US20090063835A1
