# US 2018/0321947 A1 · Protecting basic input/output (bios) code

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

- Number: US 2018/0321947 A1
- Document ID: US20180321947A1
- Status: Published application
- Kind: A1
- Application number: 15/749,468
- Filed: 2016-01-25
- Published: 2018-11-08
- Earliest claimed: 2016-01-25
- Assignees: Hewlett-Packard Development Company, L.P.
- Applicants: Hewlett-Packard Development Company, L.P
- Inventors: Wei Ze LIU; Jeffrey Kevin JEANSONNE; Dallas M BARLOW
- Web page: https://patentgrep.com/patent/US20180321947A1

## CPC

- G06F 9/4401: Bootstrapping (security arrangements therefor G06F21/57)
- G06F 21/52: during program execution, e.g. stack integrity {; Preventing unwanted data erasure; Buffer overflow}
- G06F 21/554: {involving event detection and direct action}
- G06F 21/572: {Secure firmware programming, e.g. of basic input output system [BIOS]}
- G06F 21/575: {Secure boot}
- G06F 2221/2101: Auditing as a secondary aspect
- G06F 2221/2151: Time stamp
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method of protecting basic input/output system (BIOS) code. The method includes, with a relocation information tool executed by a processor, refactoring a number of data sections within a number of handlers of the BIOS code to tag a number of variables within the handlers. The tags indicate which of the variables should be protected at runtime. The method further includes generating a relocation file comprising a number of relocation addresses identifying locations of a number of dynamic variables that change at runtime. The relocation addresses point to a location within the handlers different from an original location. The method further includes, with a loader, loading at runtime the relocation file as part of a BIOS firmware image and adjusting data access to the dynamic variables in handler code to identify the location of the dynamic variables based on the relocation file.

## Claims

### Claim 1

A method of protecting basic input/output system (BIOS) code comprising:
with a relocation information tool executed by a processor:
refactor a number of data sections within a number of handlers of the BIOS code to tag a number of variables within the handlers, the tags indicating which of the variables should be protected at runtime; and
generate a relocation file comprising a number of relocation addresses identifying locations of a number of dynamic variables that change at runtime, the relocation addresses pointing to a location within the handlers different from an original location; and
with a loader, loading at runtime the relocation file as part of a BIOS firmware image and adjusting data access to the dynamic variables in handler code to identify the location of the dynamic variables based on the relocation file.

### Claim 2 (depends on 1)

The method of claim 1, wherein the relocation file further comprises:
a number of handler names associated with each handler, and
a driver global unique identifier (GUID) associated with each of the handler names,

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
identifying handler code of the handlers;
aggregating the handler code and protected variables; and
relocating the dynamic variables to a data heap within a system maintenance mode (SMM) data storage device, the relocation addresses identifying locations in the handler code for access to the dynamic variables.

### Claim 4 (depends on 3)

The method of claim 3, further comprising, with a periodical scan module, verifying that critical data within the handlers that contain both static and dynamic members has not been altered.

### Claim 5 (depends on 4)

The method of claim 4, further comprising instructing each handler to identify a number of critical portions of the data sections within the handlers that contain both static and dynamic members, and create a list of protected ranges and a static copy of the handlers in a runtime protection table for the periodical scan module.

### Claim 6 (depends on 3)

The method of claim 3, wherein relocating the dynamic variables to a data heap comprises:
allocating memory within the SMM data storage device for a number of handlers that include the dynamic variables.

### Claim 7 (depends on 3)

The method of claim 3, wherein the handler code and the protected variables are stored in the same section of the handler during a build process of the BIOS code.

### Claim 8 (depends on 3)

The method of claim 3, further comprising modifying the loader to:
allocate memory within the SMM data storage device as a static area of the SMM data storage device where the handler code and the protected variables are stored;
change data access in the handler code to include the relocation addresses.

### Claim 9

A system for relocating data sections of a number of system management interrupt (SMI) handlers of runtime basic input/output system (BIOS) code comprising:
at least one processor;
a system management mode (SMM) data storage device to store the SMI handlers, the SMI handlers comprising handler code and a number of data sections; and
a relocation information tool stored on the SMM data storage device to, when executed by the processor:
identify handler code of the SMI handlers;
refactor a number of data sections within the SMI handlers to tag a number of variables within the SMI handlers, the tags indicating which of the variables should be protected at runtime;
aggregate the handler code and protected variables; and
relocate a number of dynamic variables to a data heap within the SMM data storage device.

### Claim 10 (depends on 9)

The system of claim 9, further comprising with a loader to load at runtime the relocation file as part of a BIOS firmware image.

### Claim 11 (depends on 9)

The system of claim 9, wherein the relocation information tool generates a relocation file comprising a number of relocation addresses identifying locations of a number of dynamic variables, the relocation addresses pointing to a location within the handlers different from an original location and identifying locations of the dynamic variables.

### Claim 12

A computer program product for protecting basic input/output system (BIOS) code, the computer program product comprising:
a non-transitory computer readable medium comprising computer usable program code embodied therewith, the computer usable program code to, when executed by a processor:
with a relocation information tool, generate a relocation file based on a map file and an ASM file, the relocation file comprising a number of driver names, a driver global unique identifier (GUID) for each of the driver names, and a number of relocation records identifying relocation addresses defining locations of a number of dynamic variables, the relocation addresses pointing to a location within a number of handlers different from an original location; and
with a loader, load at runtime the relocation file as part of a BIOS firmware image.

### Claim 13 (depends on 12)

The computer program product of claim 12, further comprising computer usable program code to, when executed by the processor:
scan a map file to identify a number of the variables referenced by a number of data sections within the handlers of the BIOS code;
parse an assembly language (ASM) source file for each of the variables; and
with the relocation information tool generate the relocation file based on the map file and the ASM file.

### Claim 14 (depends on 12)

The computer program product of claim 12, wherein the relocation file is generated on a data section level basis with respect to a number of data sections within each handler.

### Claim 15 (depends on 12)

The computer program product of claim 12, wherein the relocation information tool, when executed by the processor, refactors a number of data sections within the handlers of the BIOS code to tag a number of variables within the handlers, the tags indicating which of the variables should be protected at runtime.
