# US 2017/0364452 A1 · Timely randomized memory protection

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0364452 A1
- Document ID: US20170364452A1
- Status: Published application
- Kind: A1
- Application number: 15/185,370
- Filed: 2016-06-17
- Published: 2017-12-21
- Earliest claimed: 2016-06-17
- Assignees: Massachusetts Institute of Technology
- Applicants: Massachusetts Institute of Technology
- Inventors: Hamed Okhravi; Thomas R. Hobson; David O. Bigelow; Robert Rudd; David M. Perry; Kristin S. Dahl; William W. Streilein
- Web page: https://patentgrep.com/patent/US20170364452A1

## CPC

- G06F 12/1466: {Key-lock mechanism}
- G06F 11/1004: {to protect a block of data words, e.g. CRC or checksum (G06F11/1076 takes precedence; security arrangements for protecting computers or computer systems against unauthorized activity G06F21/00)}
- G06F 11/1048: {using arrangements adapted for a specific error detection or correction feature}
- G06F 21/52: during program execution, e.g. stack integrity {; Preventing unwanted data erasure; Buffer overflow}
- H04L 9/0894: {Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage}
- G06F 2212/1052: Security improvement
- G06F 2212/402: Encrypted data
- G06F 2221/033: Test or assess software
- H04L 2209/08: Randomization, e.g. dummy operations or using noise
- H04L 2209/34: Encoding or coding, e.g. Huffman coding or error correction
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

In a system executing a program, a method comprises detecting one or more input/output calls associated with the program and re-randomizing memory associated with the program in response to the one or more input/output calls. A related system is also described.

## Claims

### Claim 1

In a system executing a program, a method comprising:
detecting one or more input/output calls associated with the program; and
re-randomizing memory associated with the program in response to the one or more input/output calls.

### Claim 2 (depends on 1)

The method of claim 1 further comprising:
verifying state data associated with the program in response to the one or more input/output calls.

### Claim 3 (depends on 1)

The method of claim 1 wherein detecting one or more input/output calls comprises detecting one or more output calls followed by an input call.

### Claim 4 (depends on 3)

The method of claim 3 further comprising:
intercepting the input call before re-randomizing the memory; and
allowing the input call to complete after re-randomizing the memory.

### Claim 5 (depends on 1)

The method of claim 1 wherein re-randomizing the memory comprises generating random stack cookies.

### Claim 6 (depends on 5)

The method of claim 5 wherein generating the random stack cookies comprises:
generating a random master cookie;
storing the master cookie in the memory;
obtaining a stack trace for the program, the stack trace including information about one or more stack frames;
for each of the stack frames, generating a random stack cookie using the master stack cookie; and
for each of the stack frames, storing the stack cookie in the memory.

### Claim 7 (depends on 6)

The method of claim 6 further comprising:
verifying the random stack cookie for each of the stack frames using the master stack cookie.

### Claim 8 (depends on 6)

The method of claim 6 wherein the stack trace includes a memory address for each of the stack frames, and wherein generating a random stack cookie for each of the stack frames comprises performing a logical exclusive disjunction operation (XOR) between the master stack cookie and the corresponding memory address.

### Claim 9 (depends on 6)

The method of claim 6 wherein the program comprises a plurality of modules, and wherein generating the random master cookie comprises generating a random master cookie for each of the modules.

### Claim 10 (depends on 9)

The method of claim 9 further comprising, for each of the modules:
detecting the module being loaded;
determining a memory location of a master cookie associated with the module; and
in response to generating the random master cookie for the module, storing the generated master cookie at the determined memory location.

### Claim 11 (depends on 1)

The method of claim 1 wherein re-randomizing memory associated with the program comprises re-randomizing heap integrity data.

### Claim 12 (depends on 1)

The method of claim 1 wherein re-randomizing heap integrity data comprises:
generating a random secret key;
storing the random secret key in the memory;
determining a memory location for one or more heap allocations stored in the memory;
for each of the heap allocations, encrypting header information associated with the heap allocation using the secret key; and
for each of the heap allocations, storing the encrypted header information in the memory.

### Claim 13 (depends on 12)

The method of claim 12 further comprising:
verifying the encrypted header information for each of the heap allocations using the secret key.

### Claim 14 (depends on 13)

The method of claim 13 further comprising:
verifying a error-detecting code value for each of the heap allocations.

### Claim 15 (depends on 12)

The method of claim 12 further comprising, for each of the heap allocations:
generating a random heap cookie;
calculating an error-detecting code value using at least the random heap cookie; and
storing the error-detecting code value in the memory.

### Claim 16 (depends on 1)

The method of claim 1 wherein re-randomizing memory associated with the program comprises re-randomizing an encrypted function lookup table (FLT).

### Claim 17 (depends on 16)

The method of claim 16 further comprising:
generating the encrypted FLT based on an existing FLT associated with the program, the encrypted FLT having a plurality of code snippets; and
rewriting program code to replace indirect calls to the existing FLT with direct calls to the code snippets.

### Claim 18 (depends on 17)

The method of claim 17 wherein each of the code snippets includes instructions to decrypt an encrypted address associated with the code snippet using a secret key and to call a function at the decrypted address associated with the code snippet, and wherein re-randomizing the encrypted FLT comprises:
is generating a new secret key;
storing the new secret key in memory; and
updating each of the code snippets to use the new secret key.

### Claim 19 (depends on 17)

The method of claim 17 wherein re-randomizing the encrypted FLT comprises:
changing a memory location of one or more of the code snippets with the encrypted FLT; and
rewriting the program code to call the one or more code snippets at the corresponding changed memory location.

### Claim 20

A system for executing a program, the system comprising:
one or more processors;
a volatile memory; and
a non-volatile memory storing computer program code that when executed on the processor causes execution across the one or more processors of a process operable to perform the operations of:
detecting one or more input/output calls associated with the program; and
re-randomizing memory associated with the program in response to the one or more input/output calls.
