Switch System Flaws: Difference between revisions
Fun stuff |
Fun stuff part two |
||
Line 68: | Line 68: | ||
|- | |- | ||
| Null-dereference in panic() | | Null-dereference in panic() | ||
| The Switch's stage 1 bootloader, on panic(), clears the stack and then attempts to clear the Security Engine. However, it does so by dereferencing a pointer to the SE in .bss (initially NULL), and this pointer doesn't get initialized until partway into the bootloader's main() after several functions that might panic() are called. Thus, a panic() caused prior to SE initialization would result in the SE pointer still being NULL when dereferenced. | | The Switch's stage 1 bootloader, on panic(), clears the stack and then attempts to clear the Security Engine. However, it does so by dereferencing a pointer to the SE in .bss (initially NULL), and this pointer doesn't get initialized until partway into the bootloader's main() after several functions that might panic() are called. Thus, a panic() caused prior to SE initialization would result in the SE pointer still being NULL when dereferenced. | ||
The BPMP doesn't have an active MPU and the bus won't data abort on an invalid address, so no exception will be entered: it'll end up overwriting some exception vectors with NULL before halting. | |||
In 3.0.0, this was fixed by moving the security engine initialization earlier in main(), before the first function that could potentially panic(). | In 3.0.0, this was fixed by moving the security engine initialization earlier in main(), before the first function that could potentially panic(). | ||
| | | Some exception vectors overwritten with NULL, before SBK/other keyslots are cleared. Probably useless for anything more interesting. | ||
| [[3.0.0]] | | [[3.0.0]] | ||
| [[3.0.0]] | | [[3.0.0]] | ||
Line 94: | Line 95: | ||
|- | |- | ||
|} | |} | ||
=== TrustZone === | === TrustZone === |