# US 8,578,483 B2 · Systems and methods for preventing unauthorized modification of an operating system

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

- Number: US 8,578,483 B2
- Document ID: US8578483B2
- Status: Granted
- Kind: B2
- Application number: 12/221,109
- Filed: 2008-07-31
- Published: 2010-02-04
- Granted: 2013-11-05
- Earliest claimed: 2008-07-31
- Assignees: Carnegie Mellon University
- Applicants: Arvind Seshadri; Ning Qu; Adrian Perrig
- Inventors: Arvind Seshadri; Ning Qu; Adrian Perrig
- Web page: https://patentgrep.com/patent/US8578483B2

## CPC

- G06F 21/57: Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
- G06F 21/74: operating in dual or compartmented mode, i.e. at least one secure mode
- G06F 2221/2105: Dual mode as a secondary aspect
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods are provided for preventing unauthorized modification of an operating system. The system includes an operating system comprised of kernel code for controlling access to operation of a processing unit. The system further includes an enforcement agent executing at a higher privilege than the kernel code such that any changes to the kernel code are approved by the enforcement agent prior to execution.

## Claims

### Claim 1

A system for preventing unauthorized modification of an operating system, comprising:
a processing unit;
a system memory in communication with said processing unit;
an operating system for controlling the operation of said processing unit, said operating system comprised of kernel code; and
an enforcement agent executing at a higher privilege than said kernel code, wherein the enforcement agent prevents unauthorized modification of existing kernel code and injection of new code with kernel privilege by maintaining shadow copies of a global descriptor table, a local descriptor table, and one or more registers, and by only permitting entry pointers contained within the global descriptor table, the local descriptor table, and the one or more registers to point to approved kernel code.

### Claim 2 (depends on 1)

The system of claim 1, wherein said enforcement agent resides at a higher privilege level than said kernel code through virtualization.

### Claim 3 (depends on 1)

The system of claim 1, wherein said enforcement agent resides at a highest processing unit privilege level in a host mode and the kernel code executes at the highest processing unit privilege level in a guest mode.

### Claim 4 (depends on 1)

The system of claim 1, wherein said enforcement agent is configured to detect unauthorized modification of existing kernel code and injection of new code with kernel privilege from a virus, a worm, a buffer overrun, or a Trojan Horse.

### Claim 5 (depends on 1)

The system of claim 1, wherein said enforcement agent comprises means for intercepting events that occur in the operating system.

### Claim 6 (depends on 5)

The system of claim 5, wherein said means for intercepting is configured to intercept events from the group comprising instructions being run, operating system interrupts, operating system exceptions, inputs to the operating system, outputs from the operating system and changes to computer configuration settings.

### Claim 7

A system for protecting the integrity of operating system code, comprising:
an enforcement agent, executing on one or more data processors, wherein the enforcement agent prevents unauthorized modification of operating system code and injection of new operating system code by maintaining shadow copies of a global descriptor table, a local descriptor table, and one or more registers, and by only permitting entry pointers contained within the global descriptor table, the local descriptor table, and the one or more registers to point to approved operating system code.

### Claim 8 (depends on 7)

The system of claim 7, wherein said enforcement agent is configured to detect unauthorized modification of operating system code and injection of new operating system code from a virus, a worm, a buffer overrun, or a Trojan Horse.

### Claim 9 (depends on 7)

The system of claim 7, wherein said enforcement agent comprises means for intercepting operating system events.

### Claim 10 (depends on 9)

The system of claim 9, wherein said means for intercepting is configured to intercept events from the group comprising instructions being run, operating system interrupts, operating system exceptions, inputs to the operating system, outputs from the operating system and changes to computer configuration settings.

### Claim 11

A method of protecting a computer which operates in a user mode and a higher privilege operating system mode, comprising:
requiring that all entries into the higher privilege operating system mode begin execution of approved operating system instructions by maintaining shadow copies of a global descriptor table, a local descriptor table, and one or more registers, and by only permitting entry pointers contained within the global descriptor table, the local descriptor table, and the one or more registers to point to approved operating system instructions;
executing only approved operating system instructions while in the higher privilege operating system mode;
switching to user mode before running non-approved instructions; and
preventing unauthorized modification of approved instructions.

### Claim 12 (depends on 11)

The method of claim 11, additionally comprising performing said requiring, executing, switching, and preventing at a privilege level higher than the privilege level of said operating system mode.

### Claim 13 (depends on 12)

The method of claim 12, wherein said requiring includes intercepting operating system events and responding to the events.

### Claim 14

A method of maintaining kernel code integrity in an operating system, comprising:
detecting a request that an execution mode be changed to kernel mode at an address;
determining whether said address is within approved kernel code by maintaining shadow copies of a global descriptor table, a local descriptor table, and one or more registers, and by only permitting entry pointers contained within the global descriptor table, the local descriptor table, and the one or more registers to point to approved kernel code;
setting said execution mode to kernel mode if said address is within approved kernel code;
setting an instruction pointer to said address if said address is within approved kernel code;
executing instructions in kernel mode as long as said instruction pointer remains within approved kernel code;
detecting a request that said execution mode be changed to user mode; and
setting said execution mode to user mode upon detection of a request that said execution mode be changed to user mode.

### Claim 15 (depends on 14)

The method of claim 14, wherein said determining further comprises:
comparing said address to a list of entry pointers; and
determining that said address is within approved kernel code in response to said comparing.

### Claim 16 (depends on 15)

The method of claim 15, wherein said comparing comprises comparing said address to a list of entry pointers containing pointer addresses associated with control transfer events to kernel mode for a particular architecture.

### Claim 17 (depends on 15)

The method of claim 15, wherein said comparing comprises comparing said address to a virtualized copy of the list of entry pointers that are be operated on by a kernel.

### Claim 18 (depends on 15)

The method of claim 15, wherein said comparing comprises comparing said address to a virtualized copy of the list of entry pointers that are modified by a kernel through safe function calls.

### Claim 19 (depends on 15)

The method of claim 15, wherein said comparing comprises comparing said address to a virtualized copy of the list of entry pointers that are modified indirectly with shadow copies retained by a hypervisor.

### Claim 20 (depends on 19)

The method of claim 19, wherein the comparing said address to a virtualized copy of the list of entry pointers that are modified indirectly utilize shadow copies visible to a CPU that are updated to match the virtualized copies if the hypervisor determines that the modification is proper.

### Claim 21 (depends on 15)

The method of claim 15, wherein said comparing comprises comparing said address to a list of entry pointers containing pointer addresses associated with events that trigger CPU execution mode changes from user mode to kernel mode for a particular architecture.

### Claim 22 (depends on 14)

The method of claim 14, wherein said detecting a request that an execution mode be changed at an address further comprises recognizing a CPU exception.

### Claim 23 (depends on 22)

The method of claim 22, additionally comprising generating said CPU exception in response to a CPU attempting to execute kernel code that does not have an execute permission.

### Claim 24 (depends on 23)

The method of claim 23, additionally comprising managing said execute permissions via page-table based protections or segmentation based protections.

### Claim 25 (depends on 14)

The method of claim 14 wherein said setting said execution mode to kernel mode if said address is within approved kernel code further comprises setting kernel code permissions to execute and setting other memory permissions to non-execute.

### Claim 26 (depends on 22)

The method of claim 22, additionally comprising generating said CPU exception in response to a CPU attempting to execute memory code that does not have execute permission.

### Claim 27 (depends on 14)

The method of claim 14 further comprising preventing modification of approved kernel code by any peripheral without the approval of an enforcement agent.

### Claim 28

A method of protecting a computer which operates in a user mode and a higher privilege operating system mode, comprising:
requiring that all entries into the higher privilege operating system mode begin execution of approved operating system instructions by utilizing shadow page tables containing shadow copies of all existing entry pointers from a global descriptor table, a local descriptor table, an interrupt descriptor table, and one or more registers;
executing only approved operating system instructions while in the higher privilege operating system mode;
switching to user mode before running non-approved instructions by setting a CPU privilege level to Ring 3;
preventing modification of the shadow global descriptor table, local descriptor table, and interrupt descriptor table during user mode execution; and
preventing unauthorized modification of approved instructions.

### Claim 29 (depends on 1)

The system of claim 1, wherein the shadow copies of the global descriptor table and the local descriptor table are synchronized with kernel copies of the global descriptor table and the local descriptor table, respectively, when the processing unit transitions from a kernel mode to a user mode.

### Claim 30 (depends on 7)

The system of claim 7, wherein the shadow copies of the global descriptor table and the local descriptor table are synchronized with kernel copies of the global descriptor table and the local descriptor table, respectively, when the one or more data processors transition from a kernel mode to a user mode.

### Claim 31 (depends on 11)

The method of claim 11, wherein the shadow copies of the global descriptor table and the local descriptor table are synchronized with kernel copies of the global descriptor table and the local descriptor table, respectively, when the computer transitions from the higher privilege operating system mode to the user mode.

### Claim 32 (depends on 14)

The method of claim 14, wherein the shadow copies of the global descriptor table and the local descriptor table are synchronized with kernel copies of the global descriptor table and the local descriptor table, respectively, when the execution mode is changed from the kernel mode to the user mode.

### Claim 33 (depends on 28)

The method of claim 28, wherein the shadow page tables containing the shadow copies of all existing entry pointers from the global descriptor table and the local descriptor table are synchronized with kernel copies of the global descriptor table and the local descriptor table, respectively, when the computer transitions from the higher privilege operating system mode to the user mode.
