IP Library Granted Patent US 9,875,358
Granted Patent B2
US 9,875,358 · App. 14/310,463 · Granted Jan 23, 2018

Preventing code modification after boot

Inventors: Ling Tony Chen (Bellevue, WA); Felix Stefan Domke (Luebeck, DE)
Assignee: Microsoft Technology Licensing, LLC
G06F21/575G06F9/4401
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,875,358
App. No.
14/310,463
Filed
Jun 20, 2014
Granted
Jan 23, 2018
Kind
B2
Art Unit
2115
USPC
713/2
Abstract

The subject disclosure is directed towards protecting code in memory from being modified after boot, such as code used in a dedicated microprocessor or microcontroller. Hardware, such as in logic or in a memory protection unit, allows a range of memory to be made non-writeable after being loaded, e.g., via a secure boot load operation. Further, startup code that is used to configure the hardware/memory may be made non-executable after having run once, so that no further execution may occur in that space, e.g., as a result of an attack. A function in the runtime code may allow for a limited, attack-protected reconfiguration of sub-regions of memory regions during the runtime execution.

Claims (35)

1. A method comprising:

running secure boot code to load executable instructions into an executable memory space to perform a secure boot of a device, the executable memory space comprising at least a first memory space and a second memory space, the first memory space being loaded with at least a part of the executable instructions for enablement and disablement of a memory protection (MPU);

responsive to the loading of the at least a part of the executable instructions, executing the at least a part of the executable instructions loaded in the first memory space;

responsive to the execution of the at least a part of the executable instructions loaded in the first memory space, enabling the MPU,

responsive to the enablement of the MPU, rendering the second memory space executable and non-writeable by the enabled MPU, and

protecting the enabled MPU from any further changes by rendering the first memory space non-executable, and protecting the device from any malicious executable code by the enabled and protected MPU.

2. The method of claim 1 , wherein an instruction of the the at least a part of the executable instructions that enables the MPU is a last executable instruction of the at least a part of the executable instructions loaded in the first memory spaces.

3. The method of claim 1 wherein said enabling the MPU comprises:

configuring the MPU with one or more regions that contain the loaded executable instructions; and

configuring the one or more regions that contain the loaded executable instructions as non-writeable.

4. The method of claim 1 further comprising, protecting a subset of the loaded executable instructions, including any non-selected executable instructions, by preventing further execution of the subset of loaded executable instructions.

5. The method of claim 1 , wherein the loaded executable instructions comprise startup code in the first memory space and runtime code in the second memory space and wherein the method further comprises executing at least some of the executable instructions that comprise (a) executing the startup code, and at the end of the execution of the startup code, protecting the startup code by preventing further execution thereof, and (b) executing the runtime code.

6. The method of claim 5 , wherein said protecting the startup code comprises configuring the MPU with one or more regions that contain at least the startup code and configuring the one or more regions that contain at least the startup code as non-executable.

7. The method of claim 5 , wherein said protecting the startup code by preventing further execution thereof comprises generating a planned exception by attempting to execute an instruction in the first memory space, the planned exception causing an exception handler to transfer code execution to the runtime code.

8. The method of claim 5 further comprising making the runtime code unable to reconfigure the memory space.

9. The method of claim 5 further comprising making the runtime code unable to reconfigure the memory space except via one or more functions that include protection against a return oriented programming (RoP) attack.

10. A device comprising:

a microcontroller or microprocessor;

an executable memory selected to be used during execution of boot code to perform a secure boot operation, the executable memory comprising at least a first memory space and a second memory space, the first memory space being loaded with a first portion of the boot code, and the second memory space being loaded with a second portion of the boot code; and

a memory protection unit (MPU) that is enabled upon execution of at least a part of the first portion of the boot code, the enabled MPU rendering the second memory space executable and non-writeable, and protecting itself from being disabled by rendering the first memory space at least non-executable, the enabled and protected MPU and protecting the device from any malicious executable code.

11. The device of claim 10 , wherein the enabled MPU further protects the first memory space from executing again once execution of the first portion of the boot code has completed.

12. The device of claim 10 , wherein the MPU provides different memory regions, and for the different memory regions, enforces attributes that include write attributes that determine whether write access is allowed and execute attributes that determine whether instructions in that region are executable.

13. The device of claim 12 , wherein the first portion of the boot code comprises executable startup code and the second portion of the boot code comprises executable runtime code.

14. The device of claim 12 , wherein at least one region is an indexed region that is associated with a sub-region bitmask, wherein the selected executable memory contains executable runtime code including a function that allows changing of the sub-region bitmask for the indexed region.

15. The device of claim 13 , wherein the executable runtime code is unable to reconfigure the selected executable memory.

16. The device of claim 10 wherein the second memory space corresponds to a runtime code memory space, wherein the first memory space comprises startup code memory space that is executable memory until an executed instruction or set of instructions changes the startup code memory space to non-executable.

17. One or more machine-readable devices having executable instructions, which when executed perform operations, comprising:

running secure boot code to load executable instructions into an executable memory space to perform a secure boot of a device, the executable memory space comprising at least a first memory space and a second memory space, the first memory space being loaded with at least a part of the executable instructions for enablement and disablement of a memory protection unit (MPU);

responsive to the loading of the at least a part of the executable instructions, executing the at least a part of the executable instructions loaded in the first memory space;

responsive to the execution of the at least a part of the executable instructions loaded in the first memory space, enabling the MPU,

responsive to the enablement of the MPU, rendering the second memory space executable and non-writeable; and

protecting the enabled MPU from any further changes by rendering the first memory space at least non-executable, and protecting the device from any malicious executable code by the enabled and protected MPU.

18. The one or more machine-readable devices of claim 17 , wherein the loaded executable instructions comprise startup code in the first memory space and runtime code in the second memory space and wherein the executable instructions perform further operations to execute at least some of the executable instructions comprising (a) executing the startup code, and at the end of the execution of the startup code, protecting the startup code by preventing further execution thereof, and (b) executing the runtime code.

19. The one or more machine-readable devices of claim 18 , wherein said protecting the startup code comprises configuring the memory protection unit with one or more regions that contain at least the startup code and configuring the one or more regions that contain at least the startup code as non-executable.

20. The one or more machine-readable devices of claim 18 , wherein executing the runtime code, includes executing a function, the function (a) setting an index and changing a configuration of a sub-region of the second memory space based upon the index, and (b) and after changing the configuration, changing the index to correspond to a dummy region before returning from the function.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 9, 2015
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 039025/0454 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 20, 2014
From: CHEN, LING TONY; DOMKE, FELIX STEFAN
To: MICROSOFT CORPORATION
Reel/Frame 033149/0165 →
Continuity (1)
Related Publication 20150371046A1 · Dec 24, 2015