Skip to content

Commit

Permalink
[flash_ctrl/doc] Add MEM.ADDR_INFECTION feature
Browse files Browse the repository at this point in the history
This commit adds the MEM.ADDR_INFECTION to the documentation that
has been added with #23557

Signed-off-by: Pascal Nasahl <[email protected]>
  • Loading branch information
nasahlpa authored and vogelpi committed Jul 5, 2024
1 parent 6e99e0b commit f4c7229
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hw/ip_templates/flash_ctrl/data/flash_ctrl.hjson.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@
The bus integrity scheme for flash is different from other comportable modules.
'''
}
{ name: "MEM.ADDR_INFECTION",
desc: '''
On host reads, the address of the request is XORed with the data inside the read pipeline.
The request address is removed from the data before returning the data over TL-UL.
A mismatch triggers a data integrity error.
'''
}
{ name: "SCRAMBLE.KEY.SIDELOAD",
desc: "The scrambling key is sideloaded from OTP and thus unreadable by SW."
}
Expand Down
1 change: 1 addition & 0 deletions hw/ip_templates/flash_ctrl/doc/interfaces.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ ${"##"} Security Countermeasures
| FLASH_CTRL.REG.BUS.INTEGRITY | End-to-end bus integrity scheme. Since there are multiple access points for flash, please see Transmission Integrity Faults in the documentation for more details. The bus integrity scheme for flash is different from other comportable modules. |
| FLASH_CTRL.HOST.BUS.INTEGRITY | End-to-end bus integrity scheme. Since there are multiple access points for flash, please see Transmission Integrity Faults in the documentation for more details. The bus integrity scheme for flash is different from other comportable modules. |
| FLASH_CTRL.MEM.BUS.INTEGRITY | End-to-end bus integrity scheme. Since there are multiple access points for flash, please see Transmission Integrity Faults in the documentation for more details. The bus integrity scheme for flash is different from other comportable modules. |
| FLASH_CTRL.MEM.ADDR_INFECTION | On host reads, the address of the request is XORed with the data inside the read pipeline. The request address is removed from the data before returning the data over TL-UL. A mismatch triggers a data integrity error. |
| FLASH_CTRL.SCRAMBLE.KEY.SIDELOAD | The scrambling key is sideloaded from OTP and thus unreadable by SW. |
| FLASH_CTRL.LC_CTRL.INTERSIG.MUBI | Life cycle control signals are used control information partition access and flash debug access. See secret information partition, isolated information partitions and jtag connection in documentation for more details. |
| FLASH_CTRL.CTRL.CONFIG.REGWEN | Configurations cannot be changed when an operation is ongoing. |
Expand Down
8 changes: 8 additions & 0 deletions hw/ip_templates/flash_ctrl/doc/theory_of_operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,3 +507,11 @@ The expected waveform from the perspective of the physical controller is shown b
{name: 'flash_ctrl_o.prog_done', wave: '0....10.10...10'},
]}
```

### Read Data Infection Feature

This feature aims to provide additional security against fault injection attacks targeting the addresses of host flash read requests.
By default, on each host read request, the data fetched from the underyling memory is infected with the address used for the memory access.
Before returning the data to the host over the bus, the address is removed from the infected data.
When the address used for the infection matches the original address, the plain data is restored.
Otherwise, faulty data is generated, which can be detected by the data integrity mechanism.
1 change: 1 addition & 0 deletions hw/ip_templates/flash_ctrl/rtl/flash_ctrl.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ module flash_ctrl
);

// SEC_CM: HOST.BUS.INTEGRITY
// SEC_CM: MEM.ADDR_INFECTION
tlul_adapter_sram #(
.SramAw(BusAddrW),
.SramDw(BusWidth),
Expand Down
7 changes: 7 additions & 0 deletions hw/top_earlgrey/ip_autogen/flash_ctrl/data/flash_ctrl.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,13 @@
The bus integrity scheme for flash is different from other comportable modules.
'''
}
{ name: "MEM.ADDR_INFECTION",
desc: '''
On host reads, the address of the request is XORed with the data inside the read pipeline.
The request address is removed from the data before returning the data over TL-UL.
A mismatch triggers a data integrity error.
'''
}
{ name: "SCRAMBLE.KEY.SIDELOAD",
desc: "The scrambling key is sideloaded from OTP and thus unreadable by SW."
}
Expand Down
1 change: 1 addition & 0 deletions hw/top_earlgrey/ip_autogen/flash_ctrl/doc/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Referring to the [Comportable guideline for peripheral device functionality](htt
| FLASH_CTRL.REG.BUS.INTEGRITY | End-to-end bus integrity scheme. Since there are multiple access points for flash, please see Transmission Integrity Faults in the documentation for more details. The bus integrity scheme for flash is different from other comportable modules. |
| FLASH_CTRL.HOST.BUS.INTEGRITY | End-to-end bus integrity scheme. Since there are multiple access points for flash, please see Transmission Integrity Faults in the documentation for more details. The bus integrity scheme for flash is different from other comportable modules. |
| FLASH_CTRL.MEM.BUS.INTEGRITY | End-to-end bus integrity scheme. Since there are multiple access points for flash, please see Transmission Integrity Faults in the documentation for more details. The bus integrity scheme for flash is different from other comportable modules. |
| FLASH_CTRL.MEM.ADDR_INFECTION | On host reads, the address of the request is XORed with the data inside the read pipeline. The request address is removed from the data before returning the data over TL-UL. A mismatch triggers a data integrity error. |
| FLASH_CTRL.SCRAMBLE.KEY.SIDELOAD | The scrambling key is sideloaded from OTP and thus unreadable by SW. |
| FLASH_CTRL.LC_CTRL.INTERSIG.MUBI | Life cycle control signals are used control information partition access and flash debug access. See secret information partition, isolated information partitions and jtag connection in documentation for more details. |
| FLASH_CTRL.CTRL.CONFIG.REGWEN | Configurations cannot be changed when an operation is ongoing. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,3 +507,11 @@ The expected waveform from the perspective of the physical controller is shown b
{name: 'flash_ctrl_o.prog_done', wave: '0....10.10...10'},
]}
```

### Read Data Infection Feature

This feature aims to provide additional security against fault injection attacks targeting the addresses of host flash read requests.
By default, on each host read request, the data fetched from the underyling memory is infected with the address used for the memory access.
Before returning the data to the host over the bus, the address is removed from the infected data.
When the address used for the infection matches the original address, the plain data is restored.
Otherwise, faulty data is generated, which can be detected by the data integrity mechanism.
1 change: 1 addition & 0 deletions hw/top_earlgrey/ip_autogen/flash_ctrl/rtl/flash_ctrl.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,7 @@ module flash_ctrl
);

// SEC_CM: HOST.BUS.INTEGRITY
// SEC_CM: MEM.ADDR_INFECTION
tlul_adapter_sram #(
.SramAw(BusAddrW),
.SramDw(BusWidth),
Expand Down
1 change: 1 addition & 0 deletions util/reggen/countermeasure.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'REGREN',
'SHADOW',
'SCRAMBLE',
'ADDR_INFECTION',
'INTEGRITY',
'READBACK',
'ADDR_INFECTION',
Expand Down

0 comments on commit f4c7229

Please sign in to comment.