IP Library Granted Patent US 9,135,414
Granted Patent B1
US 9,135,414 · App. 13/592,260 · Granted Sep 15, 2015

Software fault isolation for arm thumb

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,135,414
App. No.
13/592,260
Granted
Sep 15, 2015
Kind
B1
Abstract

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for executing native code modules. One of the methods includes for executing a native code module includes obtaining the native code module, wherein instructions in the native code module are encoded by variable-length encoding; loading the native code module into a secure runtime environment for an ARM instruction set architecture; and safely executing the native code module in the secure runtime environment using software fault isolation (SFI) mechanisms.

Claims (65)

1. A computer-implemented method for executing a native code module, comprising:

obtaining the native code module, wherein instructions in the native code module are encoded by variable-length encoding;

loading the native code module into a secure runtime environment for an ARM instruction set architecture; and

safely executing the native code module in the secure runtime environment using software fault isolation (SFI) mechanisms by:

constraining store instructions in the native code module;

maintaining control flow integrity for the native code module by dividing a code region associated with the native code module into 16-byte code blocks comprising 8 2-byte slots, wherein

a first slot of each code block contains at least the first 16 bits of a permitted instruction; and

when a particular code block includes a slot containing an unconditional control flow instruction, all instructions contained in slots between a first slot of the particular code block and the slot containing unconditional control flow instruction are permitted instructions.

2. The method of claim 1 , wherein maintaining control flow integrity further comprises blocking exchange branch instructions intended for switching away from variable-length encoding mode.

3. The method of claim 1 , wherein a portion of the particular code block between the unconditional control flow instruction and an end of the particular code block contains data.

4. The method of claim 3 , wherein at least one of the code blocks is a data code block comprising 14 bytes of data and a two-byte branch instruction linking the data code block to another data code block.

5. The method of claim 1 , further comprising validating the native code module wherein validator is configured to accommodate the instructions in the native code module encoded by the variable-length encoding by applying the software fault isolation (SFI) mechanisms to the native code module.

6. The method of claim 1 , wherein safely executing the native code module further comprises at least one of following:

preventing the instructions in the native code module from altering R 9 ;

allowing alterations to a stack pointer register only to a valid data address; and

allowing alterations of a link register only to a valid bundle address.

7. The method of claim 1 , wherein safely executing the native code module further comprises at least one of following:

blocking instructions to compute an address by adding registers;

blocking instructions to call an operating system;

blocking instructions to switch away from variable-length encoding mode; and

blocking instructions to load data into a program counter.

8. The method of claim 1 , wherein safely executing the native code module further comprises replacing at least one of the following instructions with corresponding statically-safe sequences of instructions:

write-to-memory instructions;

indirect branch instructions; and

table-offset branch instructions.

9. The method of claim 1 , wherein safely executing the native code module further comprises at least one of the following:

masking direct updates to a stack pointer register by clearing a set of upper bits in each of the destination addresses; and

masking destination addresses associated with indirect control flow instructions by clearing a set of upper bits and a set of lower bits in each of the destination addresses.

10. A system comprising:

one or more computers configured to perform operations comprising:

obtaining a native code module, wherein instructions in the native code module are encoded by variable-length encoding;

loading the native code module into a secure runtime environment for an ARM instruction set architecture; and

safely executing the native code module in the secure runtime environment using software fault isolation (SFI) mechanisms by:

constraining store instructions in the native code module;

maintaining control flow integrity for the native code module by dividing a code region associated with the native code module into 16-byte code blocks comprising 8 2-byte slots, wherein

a first slot of each code block contains at least the first 16 bits of a permitted instruction; and

when a particular code block includes a slot containing an unconditional control flow instruction, all instructions contained in slots between a first slot of the particular code block and the slot containing unconditional control flow instruction are permitted instructions.

11. The system of claim 10 , wherein maintaining control flow integrity further comprises blocking exchange branch instructions intended for switching away from variable-length encoding mode.

12. The system of claim 10 , wherein a portion of the particular code block between the unconditional control flow instruction and an end of the particular code block contains data.

13. The system of claim 12 , wherein at least one of the code blocks is a data code block comprising 14 bytes of data and a two-byte branch instruction linking the data code block to another data code block.

14. The system of claim 10 , further comprising validating the native code module wherein validator is configured to accommodate the instructions in the native code module encoded by the variable-length encoding by applying the software fault isolation (SFI) mechanisms to the native code module.

15. The system of claim 10 , wherein safely executing the native code module further comprises at least one of following:

preventing the instructions in the native code module from altering R 9 ;

allowing alterations to a stack pointer register only to a valid data address; and

allowing alterations of a link register only to a valid bundle address.

16. The system of claim 10 , wherein safely executing the native code module further comprises at least one of following:

blocking instructions to compute an address by adding registers;

blocking instructions to call an operating system;

blocking instructions to switch away from variable-length encoding mode; and

blocking instructions to load data into a program counter.

17. The system of claim 10 , wherein safely executing the native code module further comprises replacing at least one of the following instructions with corresponding statically-safe sequences of instructions:

write-to-memory instructions;

indirect branch instructions; and

table-offset branch instructions.

18. The system of claim 10 , wherein safely executing the native code module further comprises at least one of the following:

masking direct updates to a stack pointer register by clearing a set of upper bits in each of the destination addresses; and

masking destination addresses associated with indirect control flow instructions by clearing a set of upper bits and a set of lower bits in each of the destination addresses.

19. A non-transitory computer storage medium encoded with a computer program, the program comprising instructions that when executed by one or more computers cause the one or more computers to perform operations comprising:

obtaining a native code module, wherein instructions in the native code module are encoded by variable-length encoding;

loading the native code module into a secure runtime environment for an ARM instruction set architecture; and

safely executing the native code module in the secure runtime environment using software fault isolation (SFI) mechanisms by:

constraining store instructions in the native code module;

maintaining control flow integrity for the native code module by dividing a code region associated with the native code module into 16-byte code blocks comprising 8 2-byte slots, wherein

a first slot of each code block contains at least the first 16 bits of a permitted instruction; and

when a particular code block includes a slot containing an unconditional control flow instruction, all instructions contained in slots between a first slot of the particular code block and the slot containing unconditional control flow instruction are permitted instructions.

Assignments (2)
CHANGE OF NAME Recorded Oct 2, 2017
From: GOOGLE INC.
To: GOOGLE LLC
Reel/Frame 044334/0466 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 22, 2012
From: BIFFLE, CLIFF L.; SEHR, DAVID C.; YEE, BENNET S.
To: GOOGLE INC.
Reel/Frame 029008/0559 →