mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
zerorize backup registers & fix aoram range in zeroize
backup registers are a high priority target on zeroizing because it would contain the ephemeral unlock secret, e.g. PIN code.
This commit is contained in:
parent
3293578d3e
commit
1dbb65cc97
1 changed files with 16 additions and 8 deletions
|
|
@ -397,6 +397,22 @@ pub fn die_no_std() -> ! {
|
||||||
core::arch::asm! (
|
core::arch::asm! (
|
||||||
// TODO: any SCE other security-sensitive registers to be zeorized?
|
// TODO: any SCE other security-sensitive registers to be zeorized?
|
||||||
|
|
||||||
|
// - bureg zeroize - this is priority because it has the ephemeral key
|
||||||
|
"li x1, 0x40065000",
|
||||||
|
"li x2, 0x40065020",
|
||||||
|
"30:",
|
||||||
|
"sw x0, 0(x1)",
|
||||||
|
"addi x1, x1, 4",
|
||||||
|
"bne x1, x2, 30b",
|
||||||
|
|
||||||
|
// - AORAM_MEM zeroize - also priority because it can have ephemeral secrets
|
||||||
|
"li x1, 0x50300000",
|
||||||
|
"li x2, 0x50304000",
|
||||||
|
"16:",
|
||||||
|
"sw x0, 0(x1)",
|
||||||
|
"addi x1, x1, 4",
|
||||||
|
"bne x1, x2, 16b",
|
||||||
|
|
||||||
// key regions
|
// key regions
|
||||||
"li x1, 0x40020000",
|
"li x1, 0x40020000",
|
||||||
"li x2, 0x40022700",
|
"li x2, 0x40022700",
|
||||||
|
|
@ -434,14 +450,6 @@ pub fn die_no_std() -> ! {
|
||||||
"addi x1, x1, 4",
|
"addi x1, x1, 4",
|
||||||
"bne x1, x2, 13b",
|
"bne x1, x2, 13b",
|
||||||
|
|
||||||
// - AO_MEM zeroize
|
|
||||||
"li x1, 0x40060000",
|
|
||||||
"li x2, 0x40070000",
|
|
||||||
"16:",
|
|
||||||
"sw x0, 0(x1)",
|
|
||||||
"addi x1, x1, 4",
|
|
||||||
"bne x1, x2, 16b",
|
|
||||||
|
|
||||||
// zeroize main RAM
|
// zeroize main RAM
|
||||||
"li x1, 0x61000000",
|
"li x1, 0x61000000",
|
||||||
"li x2, 0x61200000",
|
"li x2, 0x61200000",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue