Most all modern central processing units, namely those based on the x86 architecture, employ system management random access memory (SMRAM) to carry out trusted system management mode (SMM) operations. While in SMM, the processor is able to execute code and access data stored in SMRAM. This code executed while the processor is in SMM is typically referred to as SMM code. All other processor and device accesses to SMRAM are prevented, making the contents of SMRAM inaccessible to the operating system or devices. As such, in reliance upon the privileged nature of SMM, developers continue to place increasing amounts of secure data within SMRAM.
In addition to SMRAM, most modern CPUs also utilize a local advanced programmable interrupt controller (APIC) for managing CPU interrupts. Most APICs are implemented within the CPU and mapped to physical memory, where the APIC mapping may be moved within physical memory by altering a base address (e.g., “APICBASE”) within the APICBASE model specific register of the CPU. As such, an unauthorized user may utilize the APIC to attack a computer system running in SMM by moving the APIC mapping over SMRAM, thereby derailing SMRAM requests and forcing trusted SMM code to read different values than it previously wrote. Additionally, unauthorized users may place the APIC mapping over code stacks within physical memory to jump out of SMRAM upon return from SMM subroutines, thereby enabling the mounting of larger attacks.
Accordingly, a need exists to improve the security of processors utilizing SMRAM and an APIC. Additionally, a need exists to reduce the ability of the APIC to compromise the security of SMRAM and SMM operation. Furthermore, a need exists to utilize enhanced SMM code to reduce APIC interference with accesses to SMRAM.
Embodiments of the present invention are directed to methods for processing more securely. More specifically, embodiments provide effective and efficient mechanisms for reducing APIC interference with accesses to SMRAM, where enhanced SMM code implementing these mechanisms effectively reduces APIC attacks and increases the security of proprietary, confidential or otherwise secure data stored in SMRAM.
The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements.
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings. While the present invention will be discussed in conjunction with the following embodiments, it will be understood that they are not intended to limit the present invention to these embodiments alone. On the contrary, the present invention is intended to cover alternatives, modifications, and equivalents which may be included with the spirit and scope of the present invention as defined by the appended claims. Furthermore, in the following detailed description of the present invention, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, embodiments of the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the present invention.
Some portions of the detailed descriptions which follow are presented in terms of procedures, logic blocks, processing and other symbolic representations of operations on data bits within a computer memory. These descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. In the present application, a procedure, logic block, process, or the like, is conceived to be a self-consistent sequence of steps or instructions leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, although not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated in a computer system.
It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussions, it is appreciated that throughout the present invention, discussions utilizing the terms such as “writing,” “identifying,” “defining,” “determining,” “performing,” “processing,” “comparing,” “repeating,” “creating,” “modifying,” “moving,” “establishing,” “using,” “calculating,” “accessing,” “generating,” “limiting,” “copying,” “utilizing,” “reducing,” “tracking,” “routing,” “updating,” “snooping,” “preventing,” “storing,” “enabling,” “disabling,” “allowing,” “denying,” “handling,” “transferring,” “detecting,” “returning,” “changing,” “mapping,” “executing,” “halting,” or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
As depicted in
Although computer system 100 is depicted in
SMM code may track the location of SMRAM 145 using registers 116, which is important to reducing APIC interference with accesses to SMRAM. Registers 116 may contain any form of data enabling the SMM code to determine and/or approximate the location of SMRAM. For example, registers 116 may contain an address indicating the top of SMRAM (e.g., TOM) and/or an address indicating the bottom of SMRAM (e.g., TOM minus TSEG). Alternatively, one or more intermediate addresses indicating the location of SMRAM may be stored within registers 116. Moreover, it should be appreciated that alternate means may be used to locate SMRAM (e.g., by storing an extent of SMRAM on one or both sides of a given address within physical memory, etc.).
Although registers 116 are depicted in
Given that northbridge 220 is incorporated within CPU 210, memory 240 and southbridge 250 are shown coupled to CPU 210. As such, CPU 210 is able to communicate with memory 240 and device 260 utilizing northbridge 220 and southbridge 250, respectively.
To effectively reduce APIC attacks by reducing APIC interference with accesses to SMRAM, SMM code may track the location and/or size of SMRAM. As shown in
Alternatively, SMM code may estimate the location and/or size of SMRAM 320 by using one or more known addresses (e.g., stored in registers 330) and information about the extent of SMRAM on either side of the known address or addresses. For example, if the SMM code knows that SMRAM is roughly 64 kilobytes in length and can access field 336 of registers 330 to determine or estimate bottom of SMRAM 322, it can determine top of SMRAM by adding 64 kilobytes to bottom of SMRAM 322. Additionally, the SMM code may access field 334 of registers 330 to determine intermediate SMRAM address 326. Provided the SMM code can estimate the extent of SMRAM on either side of intermediate SMRAM address 326 (e.g., 44 kilobytes above and 20 kilobytes below), it can determine or approximate the location and/or size of SMRAM.
Registers 330 may comprise one or more registers (e.g., 116 and/or 126) within a processor (e.g. 110 and/or 210) for tracking the size and/or location of SMRAM. As such, registers 330 may be MSRs or non-MSRs. Additionally, although fields 332, 334 and 336 are shown as contiguous fields, it should be appreciated that the fields may be non-contiguous fields with the same or different registers. And although fields 332, 334 and 336 all point to locations representing a contiguous SMRAM block within the same memory (e.g., 310), it should be appreciated that SMRAM may be spread over multiple locations of one or more memories. As such, the fields of registers 330 may point to one or more locations within the same memory, or instead to locations within two or more memories.
To effectively reduce APIC attacks by reducing APIC interference with accesses to SMRAM, SMM code may track the location and/or size of APICs. As shown in
Alternatively, SMM code may estimate the location and/or size of the mapping of APIC 450 by using one or more known addresses (e.g., stored in registers 430) and information about the extent of the APIC mapping on either side of the known address or addresses. For example, if the SMM code knows that the APIC mapping is roughly 4 kilobytes in length and can access field 436 of registers 430 to determine or estimate APICBASE 452, it can determine top of APIC by adding 4 kilobytes to APICBASE 452. Additionally, the SMM code may access field 434 of registers 430 to determine intermediate APIC address 456. Provided the SMM code can estimate the extent of the APIC mapping on either side of intermediate APIC address 456 (e.g., 2500 bytes above and 1500 bytes below), it can determine or approximate the location and/or size of the APIC mapping.
Registers 430 may comprise one or more registers (e.g., 116 and/or 126) within a processor (e.g. 110 and/or 210) for tracking the size and/or location of an APIC mapping. As such, registers 430 may be MSRs or non-MSRs. Additionally, although fields 432, 434 and 436 are shown as contiguous fields, it should be appreciated that the fields may be non-contiguous fields with the same or different registers. And although fields 432, 434 and 436 all point to locations representing a contiguously-mapped APIC block within the same memory (e.g., 410), it should be appreciated that the APIC mapping may be spread over multiple locations of one or more memories. As such, the fields of registers 430 may point to one or more locations within the same memory, or instead to locations within two or more memories.
Referring back to
Turning again to
As discussed above with respect to
After SMM gains control, an initial location of an APIC mapping may be stored in step 620. The initial location of the APIC mapping may be an address range to which an APIC is mapped (e.g., 450) prior to the SMI. Additionally, the initial location may be stored by the SMM code in a save state area of SMRAM. Alternatively, the initial location of the APIC mapping may be saved to registers (e.g., 116, 216, etc.) for later access and storage in a memory (e.g., 140).
As shown in
After relocating the APIC mapping to a default location, SMM tasks may be executed in step 640. Given that the APIC mapping was relocated in step 630, interference with execution of these SMM tasks may be reduced. As such, security for execution of SMM tasks is increased.
As shown in
After SMM gains control, an initial location of an APIC mapping may be stored in step 720. The initial location of the APIC mapping may be an address range to which an APIC is mapped (e.g., 450) prior to the SMI. Additionally, the initial location may be stored by the SMM code in a save state area of SMRAM. Alternatively, the initial location of the APIC mapping may be saved to registers (e.g., 116, 216, etc.) for later access and storage in a memory (e.g., 140).
As shown in
Step 740 involves SMM code relocating an APIC mapping to the updated location (e.g., that determined in step 730). As such, the APIC may be moved (e.g., to the updated location) during SMM (e.g., as described above with respect to
After relocating the APIC mapping to the updated location, SMM tasks may be executed in step 750. Given that the APIC mapping was relocated in step 740, interference with execution of these SMM tasks may be reduced. As such, security for execution of SMM tasks is increased.
As shown in
Step 820 involves accessing an initial location of an APIC mapping. The initial location of the APIC mapping may be an address range to which an APIC is mapped (e.g., 450) prior to the SMI. Additionally, the initial location may be stored by the SMM code in a save state area of SMRAM. Alternatively, the initial location of the APIC mapping may be saved to registers (e.g., 116, 216, etc.) for later access and storage in a memory (e.g., 140).
As shown in
After determining an initial location of the APIC mapping and the current location of SMRAM, a determination is made in step 840 by SMM code as to whether the APIC mapping overlaps SMRAM. In one embodiment, if it is determined that the APIC mapping and SMRAM overlap, then SMM tasks may be executed in step 842. Thereafter, a resume (RSM) instruction may be executed in step 844, which may be followed by a return of control to the processor (e.g., 110, 210, etc.) and/or software running on the processor. As such, non-SMM operation may resume and process 800 may conclude.
Alternatively, if it is determined in step 840 by SMM code that the APIC mapping overlaps SMRAM, the initial location of the APIC mapping (e.g., as accessed in step 820) may be stored in step 850 analogously to step 620. After storing an initial location of an APIC mapping, the APIC mapping may be relocated by SMM code to a default location in step 860 analogously to step 630. As such, the APIC may be moved by SMM code (e.g., as described above with respect to
As shown in
Step 920 involves accessing an initial location of an APIC mapping. The initial location of the APIC mapping may be an address range to which an APIC is mapped (e.g., 450) prior to the SMI. Additionally, the initial location may be stored by the SMM code in a save state area of SMRAM. Alternatively, the initial location of the APIC mapping may be saved to registers (e.g., 116, 216, etc.) for later access and storage in a memory (e.g., 140).
As shown in
After determining an initial location of the APIC mapping and the current location of SMRAM, a determination is made in step 940 by SMM code as to whether the APIC mapping overlaps SMRAM. In one embodiment, if it is determined that the APIC mapping and SMRAM overlap, then SMM tasks may be executed in step 942. Thereafter, a resume (RSM) instruction may be executed in step 944, which may be followed by a return of control to the processor (e.g., 110, 210, etc.) and/or software running on the processor. As such, non-SMM operation may resume and process 900 may conclude.
Alternatively, if it is determined in step 940 by SMM code that the APIC mapping overlaps SMRAM, the initial location of the APIC mapping (e.g., as accessed in step 920) may be stored in step 950 analogously to step 720. An updated location may be chosen for the APIC mapping in step 960 (e.g., analogously to step 730), where interference with SMM tasks using the APIC may be reduced in the updated location. Thereafter, the APIC mapping may be relocated by SMM code to the updated location in step 965 analogously to step 740. As such, the APIC may be moved by SMM code (e.g., as described above with respect to
As shown in
Step 1020 involves making a determination as to whether the APIC is enabled. The enabled status of the APIC may be determined by SMM code through the access of data pertaining to the enabled status of the APIC (e.g., an enabled status flag, etc.), where the data may be stored in a processor register (e.g., 116, 216, etc.), northbridge register, memory (e.g., 140, 240, etc.), etc.
If the APIC is found to be disabled in step 1020, then SMM tasks may be executed in step 1030. It should be appreciated that the term “disabled” may refer to a condition where the APIC is rendered inoperable, or alternatively where the ability of the APIC to interfere with SMM tasks is reduced to a predetermined threshold. As such, SMM tasks may be executed in a more secure fashion. Thereafter, a resume (RSM) instruction may be executed in step 1040, which may be followed by a return of control to the processor (e.g., 110, 210, etc.) and/or software running on the processor. As such, non-SMM operation may resume and process 1000 may conclude.
Alternatively, if the APIC is found to be enabled in step 1020, the APIC may then be disabled in step 1050. The APIC may be disabled by SMM code toggling a global enable/disable flag, where the flag may be stored within a register of the processor (e.g., 116 and/or 216) or the northbridge. Alternatively, SMM code toggling the state of a software enable/disable flag may be used to disable the APIC, where the flag may be stored within a register of the processor (e.g., 116 and/or 216) or the northbridge. And in another embodiment, other means may be used to disable the APIC. As such, once the APIC is disabled, SMM tasks may be executed in step 1060 with reduced interference from the APIC mapping.
After completion of SMM tasks, the APIC may be re-enabled in step 1070. Thereafter, a resume (RSM) instruction may be executed in step 1080, which may be followed by a return of control to the processor (e.g., 110, 210, etc.) and/or software running on the processor. As such, non-SMM operation may resume and process 1000 may conclude.
Step 1120 involves accessing an initial location of an APIC mapping. The initial location of the APIC mapping may be an address range to which an APIC is mapped (e.g., 450) prior to the SMI. Additionally, the initial location may be stored by the SMM code in a save state area of SMRAM. Alternatively, the initial location of the APIC mapping may be saved to registers (e.g., 116, 216, etc.) for later access and storage in a memory (e.g., 140).
As shown in
Step 1140 involves SMM code determining an allowable overlap of an APIC mapping and SMRAM. The allowable overlap may be determined by an amount of overlap relating to an acceptable amount of interference by the APIC with accesses to SMRAM. As such, the allowable overlap may not exceed an amount of overlap such that the interference is unacceptable, where the acceptability threshold may be predetermined or determined by the SMM code on the fly. Alternatively, where minimal or no interference is desired, the allowable overlap may be determined to be minimal or non-existent.
In step 1150, a determination is made by SMM code as to whether the overlap of the APIC mapping and SMRAM exceed the allowable overlap (e.g., determined in step 1140). If it is determined that the actual overlap exceeds the allowable overlap, then the processor may be halted in step 1160, thereby preventing further execution by the processor. In one embodiment, a halt (HLT) instruction may be executed upon determining an excessive overlap. Alternatively, other means may be used to prevent the processor from resuming execution (e.g., an infinite loop, etc.). As such, SMM code may reduce APIC interference with accesses to SMRAM by halting the computer system upon determining an overlap of the APIC mapping and SMRAM. Moreover, embodiments narrow the window of vulnerability open to malicious attackers by reducing the number of writes to memory necessary to perform process 1100.
Alternatively, if it is determined in step 1150 that the actual overlap does not exceed the allowable overlap determined in step 1140, then SMM tasks may be executed in step 1170. Thereafter, a resume (RSM) instruction may be executed in step 1180, which may be followed by a return of control to the processor (e.g., 110, 210, etc.) and/or software running on the processor. As such, non-SMM operation may resume and process 1100 may conclude.
Step 1220 involves accessing an initial location of an APIC mapping. The initial location of the APIC mapping may be an address range to which an APIC is mapped (e.g., 450) prior to the SMI. Additionally, the initial location may be stored by the SMM code in a save state area of SMRAM. Alternatively, the initial location of the APIC mapping may be saved to registers (e.g., 116, 216, etc.) for later access and storage in a memory (e.g., 140).
As shown in
Alternatively, if the level of interference of the APIC mapping with the execution of SMM tasks is determined to be acceptable (e.g., at or below an acceptable interference threshold), then SMM tasks may be executed in step 1250. Thereafter, a resume (RSM) instruction may be executed in step 1260, which may be followed by a return of control to the processor (e.g., 110, 210, etc.) and/or software running on the processor. As such, non-SMM operation may resume and process 1200 may conclude.
In the foregoing specification, embodiments of the invention have been described with reference to numerous specific details that may vary from implementation to implementation. Thus, the sole and exclusive indicator of what is, and is intended by the applicant to be, the invention is the set of claims that issue from this application, in the specific form in which such claims issue, including any subsequent correction. Hence, no limitation, element, property, feature, advantage, or attribute that is not expressly recited in a claim should limit the scope of such claim in any way. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.
The present application is a continuation of U.S. patent application Ser. No. 11/644,224, filed Dec. 22, 2006, entitled “SYSTEM MANAGEMENT MODE CODE MODIFICATIONS TO INCREASE COMPUTER SYSTEM SECURITY,” naming David A. Dunn as the inventor, assigned to the assignee of the present invention, and having attorney docket number TRAN-P520. That application is incorporated herein by reference in its entirety and for all purposes. The present application is related to U.S. patent application Ser. No. 11/479,703, filed Jun. 29, 2006, entitled “PROCESSOR AND NORTHBRIDGE MODIFICATIONS TO INCREASE COMPUTER SYSTEM SECURITY,” naming David A. Dunn as the inventor, assigned to the assignee of the present invention, and having attorney docket number TRAN-P497. That application is incorporated herein by reference in its entirety and for all purposes. The present application is related to U.S. patent application Ser. No. 11/479,486, filed Jun. 29, 2006, entitled “PROCESSOR MODIFICATIONS TO INCREASE COMPUTER SYSTEM SECURITY,” naming David A. Dunn as the inventor, assigned to the assignee of the present invention, and having attorney docket number TRAN-P519. That application is incorporated herein by reference in its entirety and for all purposes.
Number | Date | Country | |
---|---|---|---|
Parent | 11644224 | Dec 2006 | US |
Child | 12574599 | US |