# US 2021/0344499 A1 · Method for improving safety of a component or system running a firmware or a finite state machine

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

- Number: US 2021/0344499 A1
- Document ID: US20210344499A1
- Status: Published application
- Kind: A1
- Application number: 16/624,070
- Filed: 2019-02-22
- Published: 2021-11-04
- Earliest claimed: 2019-02-22
- Assignees: Micron Technology, Inc.
- Applicants: Micron Technology, Inc.
- Inventors: Alberto Troia; Antonino Mondello
- Web page: https://patentgrep.com/patent/US20210344499A1

## CPC

- G06F 11/3013: {where the computing system is an embedded system, i.e. a combination of hardware and software dedicated to perform a certain function in mobile devices, printers, automotive or aircraft systems (testing or monitoring of control systems or parts thereof G05B23/02)}
- H04L 9/3239: {involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD}
- G06F 11/0736: {in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function (testing or monitoring of automated control systems G05B23/02)}
- G06F 11/0751: {Error or fault detection not based on redundancy (power supply failures G06F1/30; network fault management H04L41/06)}
- G06F 11/302: {where the computing system component is a software system}
- G06F 11/3058: {Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations (thermal management in cooling arrangements of a computing system G06F1/206)}
- G06F 11/3409: {for performance assessment}
- G06F 11/3612: {by runtime analysis (performance monitoring G06F11/3466)}
- G06F 21/52: during program execution, e.g. stack integrity {; Preventing unwanted data erasure; Buffer overflow}
- G06F 21/572: {Secure firmware programming, e.g. of basic input output system [BIOS]}
- H04L 9/0643: {Hash functions, e.g. MD5, SHA, HMAC or f9 MAC}
- G06F 2221/033: Test or assess software
- H04L 9/50: {using hash chains, e.g. blockchains or hash trees}
- 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

The present disclosure relates to analyzing a firmware or a finite state machine, decomposing the same into a plurality of routines or states, individuating significative instructions or states, associating each significative instruction or state with a watchpoint calculating first HASH values of the watchpoints using a HASH function before running the firmware or finite state machine for all allowable paths in the firmware or finite state machine corresponding to a correct working of the same, storing the set of first HASH values as calculated, calculating second HASH values of the watchpoints using a HASH function when running of the firmware or finite state machine, comparing the second HASH value of each watchpoint as calculated with the stored set of first HASH values, and validating the instruction or state of a watchpoint as correct if its second HASH value is comprised in the first HASH values of the allowed paths.

## Claims

### Claim at position 1

1-26. (canceled)

### Claim 27

A method, comprising:
analyzing a firmware or a finite state machine;
decomposing the firmware or the finite state machine into a plurality of routines or states;
individuating significative instructions of the firmware or states of the finite state machine;
associating each significative instruction or state with a watchpoint;
calculating first HASH values of the watchpoints using a HASH function before running the firmware or finite state machine for all allowable paths in the firmware or the finite state machine corresponding to a correct working of the firmware or finite state machine;
storing the first HASH values as calculated;
calculating second HASH values of the watchpoints using a HASH function when running of the firmware or finite state machine;
comparing the second HASH value of each watchpoint as calculated with the stored first HASH values; and
validating the instruction or state of a watchpoint as correct if its second HASH value is comprised in the first HASH values of the allowable paths.

### Claim 28 (depends on 27)

The method of claim 27, wherein the significative instructions or states are begin/end instructions of routines of the firmware or specific executions states of the finite state machine.

### Claim 29 (depends on 27)

The method of claim 27, wherein calculating the first HASH values and calculating the second HASH values use a same HASH function.

### Claim 30 (depends on 27)

The method of claim 27, wherein the HASH function is a cryptographic HASH function or Secure Hash Algorithm SHA-256.

### Claim 31 (depends on 27)

The method of claim 27, wherein calculating the first HASH values is performed for the firmware during a compiling phase or for the finite state machine during a synthesis phase.

### Claim 32 (depends on 27)

The method of claim 27, wherein comparing the second HASH value of each watchpoint as calculated with the stored first HASH values is made starting from the first watchpoint in the runtime of the firmware or finite state machine or from any watchpoint in the debug and/or validation procedures of the firmware or finite state machine.

### Claim 33 (depends on 27)

The method of claim 27, further comprising:
calculating cumulated HASH values of a sequence of instructions or states by linking a HASH value of a watchpoint under examination to HASH values of previous watchpoints according to the following formula:
FT_HASHk=HASH[FT_HASHk-1|HASH(watchpoint WP #i)], wherein:
FT_HASH is a cumulated HASH value,
watchpoint WP #i is watchpoint under examination,
k is a current clock period,
k−1 is a previous clock period, and
| is a union between HASH values, and
wherein the cumulated HASH value is calculated by applying the HASH function at each step of the routines of a firmware or at each transition between states of a finite state machine.

### Claim 34 (depends on 33)

The method of claim 33, wherein the second HASH value of an end watchpoint of the sequence of instructions or states is the last cumulated HASH value as calculated.

### Claim 35 (depends on 33)

The method of claim 33, further comprising:
storing the cumulated HASH values as calculated for each watchpoint being examined.

### Claim 36 (depends on 27)

The method of claim 27, wherein the first and second HASH values of a watchpoint are calculated by using a program counter value of the corresponding instruction for a firmware or a status for a finite state machine.

### Claim 37 (depends on 27)

The method of claim 27, wherein associating the significative instructions or states and the watchpoints is performed in an automatic manner based on a list during design of the firmware or finite state machine.

### Claim 38 (depends on 27)

The method of claim 27, wherein associating the significative instructions or states and the watchpoints is performed in a manual manner based on design choices during design of the firmware or finite state machine.

### Claim 39

An apparatus, comprising:
a first component configured to run firmware or a finite state machine;
a second component configured to store the firmware or finite state machine;
a plurality of sensors connected to the first component and configured to provide thereto input signals; and
a plurality of actuators connected to the component and configured to receive therefrom control signals;
wherein the first component is configured to:
calculate first HASH values associated to watchpoints of significative instructions or states of the firmware or finite state machine using a HASH function;
calculate second HASH values when the firmware or finite state machine is running;
store the first HASH values;
compare the second HASH value of each watchpoint as calculated with the stored first HASH values; and
validate an instruction or state of a watchpoint as correct if its second HASH value is comprised in the first HASH values.

### Claim 40 (depends on 39)

The apparatus of claim 39, wherein the first component is configured to:
calculate cumulated HASH values of a sequence of instructions or states by linking a HASH value of a watchpoint under examination to HASH values of previous watchpoints according to the following formula:
FT_HASHk=HASH[FT_HASHk-1|HASH(watchpoint WP #i)], wherein:
FT_HASH is a cumulated HASH value;
watchpoint WP #i is the watchpoint under examination;
k is a current clock period;
k−1 is a previous clock period; and
| is a union between HASH values,
calculate the cumulated HASH value by applying the HASH function at each step of the routines of the firmware or at each transition between states of the finite state machine; and
a register, wherein the register is configured to:
store the cumulated HASH values corresponding to all already visited watchpoints of the firmware or finite state machine.

### Claim 41 (depends on 39)

The apparatus of claim 39, further comprising:
a compiler or a tool generating a hardware code for the first component.

### Claim 42 (depends on 39)

The apparatus of claim 39, wherein the first component is configured to:
provide a result of a comparison between the first and second HASH values as a warning signal, when such a comparison has indicated a wrong or potentially dangerous sequence of instructions or states for the firmware or finite state machine of the component.

### Claim 43 (depends on 39)

The apparatus of claim 39, wherein the first component is included in one of:
a vehicle, an airplane, or a control system of a plant.

### Claim 44

A method, comprising:
analyzing a sequence of instructions and individuating significative ones;
associating each significative instruction with a watchpoint;
calculating first unique values of the watchpoints by using a predefined function before executing the sequence of instructions for all allowable paths in the sequence of instructions corresponding to a correct working of a component executing the sequence of instructions;
storing the first unique values as calculated;
calculating second unique values of the watchpoint using a predefined function when executing the sequence of instructions;
comparing the second unique value of each watchpoint as calculated with the stored first unique values; and
validating the instruction of a watchpoint as correct if its second unique value is comprised in the first unique values of the allowable paths.

### Claim 45 (depends on 44)

The method of claim 44, wherein calculating the first unique values and calculating the second unique values use a same predefined function.

### Claim 46 (depends on 44)

The method of claim 44, wherein the sequence of instructions is a plurality of routines or states of a firmware or a finite state machine and the predefined function is a HASH function.
