Predicated control flow and store instructions for native code module security
AssigneeGoogle Inc.
InventorsRobert Muth, Karl Schmipf, David C. Sehr, Clifford L. Biffle
Life of this patent
Estimating the term…
Abstract
Some embodiments provide a system that executes a native code module. During operation, the system obtains the native code module. Next, the system loads the native code module into a secure runtime environment. Finally, the system safely executes the native code module in the secure runtime environment by using a set of software fault isolation (SFI) mechanisms that use predicated store instructions and predicated control flow instructions, wherein each predicated instruction from the predicated store instructions and the predicated control flow instructions is executed if a mask condition associated with the predicated instruction is met.
Claims18
A computer-implemented method for executing a native code module, comprising:
- obtaining the native code module in a computing system;
- validating, by the computing system, the native code module, by performing operations that include:
- identifying each branch instruction and each store instruction in the native code module that has a respective computed destination address,
- comparing the respective computed destination addresses of the identified branch instructions and store instructions with a predetermined address constraint,
- setting, as a result of the comparing, one or more processor condition codes that indicate whether a validation condition is satisfied, and
- verifying that each of the identified branch instructions and store instructions is a predicated instruction that is executed only if the validation condition indicated by the one or more processor condition codes is satisfied;
- and
- in response to validating the native code module, executing the native code module in a secure runtime environment of the computing system.
A system for executing a native code module, comprising:
- a web browser configured to obtain the native code module;
- a validator configured to validate the native code module by:
- identifying each branch instruction and each store instruction in the native code module that has a respective computed destination address,
- comparing the respective computed destination addresses of the identified branch instructions and store instructions with a predetermined address constraint,
- setting, as a result of the comparing, one or more processor condition codes that indicate whether a validation condition is satisfied, and
- verifying that each of the identified branch instructions and store instructions is a predicated instruction that is executed only if the validation condition indicated by the one or more processor condition codes is satisfied;
- and
- a secure runtime environment associated with the web browser, wherein the secure runtime environment is configured to execute the native code module in response to the native code module having been validated.
A non-transitory computer-readable storage medium storing instructions that when executed by one or more processors cause performance of operations for executing a native code module, the operations comprising:
- obtaining the native code module in a computing system;
- validating, by the computing system, the native code module, by performing operations that include:
- identifying each branch instruction and each store instruction in the native code module that has a respective computed destination address,
- comparing the respective computed destination addresses of the identified branch instructions and store instructions with a predetermined address constraint,
- setting, as a result of the comparing, one or more processor condition codes that indicate whether a validation condition is satisfied, and
- verifying that each of the identified branch instructions and store instructions is a predicated instruction that is executed only if the validation condition indicated by the one or more processor condition codes is satisfied;
- and
- in response to validating the native code module, executing the native code module in a secure runtime environment of the computing system.
Dependencies are inferred from the claim text.