# US 2019/0377574 A1 · Memory access instructions with additional protection flag enforcement

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

- Number: US 2019/0377574 A1
- Document ID: US20190377574A1
- Status: Published application
- Kind: A1
- Application number: 16/002,839
- Filed: 2018-06-07
- Published: 2019-12-12
- Earliest claimed: 2018-06-07
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Florian Weimer
- Web page: https://patentgrep.com/patent/US20190377574A1

## CPC

- G06F 9/30043: {LOAD or STORE instructions; Clear instruction}
- G06F 21/52: during program execution, e.g. stack integrity {; Preventing unwanted data erasure; Buffer overflow}
- G06F 9/3004: {to perform operations on memory}
- G06F 21/6218: {to a system of files or objects, e.g. local or distributed file system or database}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for executing an augmented program instruction are described. An example method may include a central processing unit receiving an executable program instruction. The central processing unit determines that the executable program instruction is an augmented program instruction. The augmented program instruction may include operands that provide input for an operation to be performed and an additional operand specifying a validation permission value to be compared to a permission value associated with a page table entry referenced by the augmented program instruction. Upon determining that the validation permission value specified in the augmented program instruction matches the permission value associated with the page table entry referenced by the augmented program instruction, the central processing unit performing the operation specified by the augmented program instruction.

## Claims

### Claim 1

A method comprising:
receiving, by a central processing unit (CPU), an executable program instruction;
determining that the executable program instruction is an augmented load instruction; and
responsive to determining that a first permission value specified by the augmented load instruction matches a second permission value associated with a page table entry associated with a memory address referenced by the augmented load instruction, loading, into a register, contents of a memory location referenced by the memory address.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
responsive to determining that the first permission value specified by the augmented load instruction does not match the second permission value associated with the page table entry, triggering an exception for the augmented load instruction.

### Claim 3 (depends on 1)

The method of claim 1, wherein the first permission value comprises a two-bit read flag, a two-bit write flag, and a two-bit execute flag, each configured to encode values of either: true, false, or not applicable.

### Claim 4 (depends on 1)

The method of claim 1, wherein the first permission value specified by the augmented load instruction comprises a read-only permission value.

### Claim 5 (depends on 1)

The method of claim 1, wherein the second permission value associated with the page table entry comprises a read/write permission flag indicating whether the memory referenced by the memory address is read-only or read and write.

### Claim 6 (depends on 5)

The method of claim 5, wherein the first permission value specified by the augmented load instruction comprises a read-only permission value; and
wherein determining whether the first permission value specified in the augmented load instruction matches the second permission value associated with the page table entry comprises determining that the read/write permission flag is set to zero.

### Claim 7 (depends on 1)

The method of claim 1, wherein the executable program code implements a bytecode interpreter.

### Claim 8

A system comprising:
a memory; and
a processor operatively coupled to the memory, to execute a compiler to:
receive source code to be compiled;
generate, in view of the source code, an augmented load instruction comprising a first operand specifying a source memory location, a second operand specifying a destination memory location, and a third operand specifying a validation permission value to be compared to a permission value associated with a page table entry for the source memory location.

### Claim 9 (depends on 8)

The system of claim 8, wherein the validation permission value specifies a read-only permission.

### Claim 10 (depends on 8)

The system of claim 8, wherein the validation permission value further specifies that a data segment referenced by the page table entry comprises executable bytecode.

### Claim 11 (depends on 8)

The system of claim 8, wherein generating the augmented load instruction is performed responsive to identifying an augmented load annotation associated with a part of the source code.

### Claim 12 (depends on 8)

The system of claim 8, wherein generating the augmented load instruction is performed responsive to identifying that the source code references a virtual function indicating that a load operation encoded by the source code is to be performed as an augmented load operation.

### Claim 13

A non-transitory computer readable storage medium, having instructions stored therein, which when executed by a processing device of a computer system, cause the processing device to:
receive, by a central processing unit (CPU), an executable program instruction;
determine that the executable program instruction is an augmented load instruction, wherein the augmented load instruction specifies a first permission value;
access a protection key index specified by a page table entry associated with a memory address referenced by the augmented load instruction;
retrieve, from a protection key register, an access permission value mapped to the protection key index;
determine whether the first permission value specified by the augmented load instruction matches the access permission value; and
responsive to determining that the first permission value matches the access permission value, load, into a register, contents of a memory location referenced by the memory address.

### Claim 14 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein the processing device is further to:
responsive to determining that the first permission value does not match the access permission value, trigger an exception for the augmented load instruction.

### Claim 15 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein the first permission value comprises a two-bit read flag, a two-bit write flag, and a two-bit execute flag, each configured to encode values of either: true, false, or not applicable.

### Claim 16 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein the access permission value mapped to the protection key index comprises a read-only permission value.

### Claim 17 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein the first permission value specified by the augmented load instruction is a custom permission value specifying that a data segment referenced by the page table entry comprises executable bytecode and is read-only; and
wherein the access permission value mapped to the protection key index is a custom permission value specifying that the data segment comprises executable bytecode and is read-only.

### Claim 18 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein the executable program instruction implements a bytecode interpreter.

### Claim 19 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein the protection key index is a memory protection key index value and the protection key register is a memory protection key register.

### Claim 20 (depends on 13)

The non-transitory computer readable storage medium of claim 13, wherein the protection key index is an authority mask register key index value and the protection key register is an authority mask register.
