Commit graph

183 commits

Author SHA1 Message Date
bunnie
4e1a3beb3c try to restructure repo to work with...idk why i am even trying. 2022-07-22 18:54:21 +08:00
bunnie
ee4e2e5d65 fix metadata on packaging for precursor_updater
still not sure how to make this actually work as i want it to,
but at least there's a thing you can run to like...get dependencies,
I guess.

lame.
2022-07-22 18:10:32 +08:00
bunnie
8f6fa5f53d add a first draft of precursor_updater.py
this should be an "all in one" updater.
2022-07-22 03:46:31 +08:00
bunnie
bad4865ea3 shift restore.py to look at the tagged releases for artifacts 2022-07-21 01:10:52 +08:00
bunnie
8dc9dddfdd modify pdddbg.py to handle swapped up DNA for verifying rekey ops 2022-07-19 03:17:32 +08:00
bunnie
8f439f8d61 add the beginning of a CI/analysis tool for backups
for now all the tool can do is just make sure that the
header is valid, but it can't decrypt or operate on
the backup itself.
2022-07-17 22:49:03 +08:00
bunnie
8e6728d743 improve error handling in restore script 2022-07-17 22:48:03 +08:00
bunnie
13e13fdfd6 add some explanation in the restore process 2022-07-17 18:50:28 +08:00
bunnie
802decb55a initial drafts at the backup and restore helper scripts
very, very rough but i was able to run through an entire
cycle exactly once successfully.

much more testing needed.
2022-07-17 03:13:42 +08:00
bunnie
9c7b1e3228 update update script verbiage to reflect the latest flow 2022-07-17 03:13:13 +08:00
bunnie
7248f47ca8 fix self-signing to reflect extra data for semvers
the loader is a little funky, and requires some maintainer hand-holding
due to the split of the page ownership between the root-keys
crate and the graphics-server crate.

Improved docs so I don't forget this detail in the future.
2022-07-11 16:11:32 +08:00
bunnie
2ad7ed10d6 bump semver version 2022-07-11 04:13:19 +08:00
bunnie
1256fcb411 add min version requirement and current version to kernel and loader 2022-07-08 18:56:05 +08:00
bunnie
40b16b3cdb inject current semver info into signature appendix on loader and kernel
this allows for a quick readout of the version of each of these
artifacts, inside a signed region, by just inspecting the last
few words of the binary object.
2022-07-08 04:08:37 +08:00
bunnie
ae8fe799bc add a fuzzer for basis lock/unlocking
this commits a script that will repeatedly rerun the `btest`
which creates several Bases, fills them with pseudorandom datat,
and goes through a lock/unlock cycle.

should be run with the disk size set to 4MiB for maximum stress
testing (the larger disk won't trigger an FSCB refill because its
hard to run out free space on the larger disk size)
2022-07-04 17:53:29 +08:00
bunnie
97ae56915e fix edge case in --dump mode for pddbdb.py
shouldn't crash when not in CI analysis mode
2022-07-04 17:52:59 +08:00
bunnie
f14cce55ff update the updater readme
The FPGA gateware region is blocked from trivial readout via USB:
this makes it a tiny bit harder to obtain the gateware image, which
contains the secret keys. This slightly aids users who haven't
burned any efuse keys and are using the default "null" key from
a trivial readout attack, and it also hampers a WBSTAR exploit.

This makes the most convenient path of attack to be loading
a custom xous.img (or otherwise exploiting the kernel) with
a gadget that is capable of reading the gateware region
through priveleged code, and then relaying it over USB through
some run-around of the firewall. This primitive isn't impossible
to create but it doesn't exist and has no use in a normal
operational flow, so, it's going to at least force an attacker
to write some code, as opposed to using off the shelf utilities
we provide.
2022-06-29 13:20:52 +08:00
bunnie
e32ea4d3f5 fix #174 2022-06-10 21:36:53 +08:00
Sean Cross
aa436cbcc7 tools: elf: don't get raw_data for no_copy sections
The `xmas-elf` crate doesn't deal with `raw_data()` of sections that are
`NO_COPY`. These sections may point to data that is outside of the file.

In order to avoid hitting this assert, don't call `raw_data()` on
sections that are marked `NO_COPY`.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-10 16:52:57 +08:00
bunnie
7112b6a15f add a script to help extract keyboard mappings for unknown keyboards
use `usb kbdtest` to output a mapping assuming US-101 maps
it will then derive an appropriate keymap based on that mapping

doesn't support non-ascii characters (yet)
2022-05-17 16:39:48 +08:00
bunnie
02daea2f0e add a note for STAGING area as well 2022-04-22 02:48:52 +08:00
bunnie
5bdd3a9f51 modifications to prepare for enhanced USB security
The next release will feature an access control on USB so that
root keys and the encrypted gateware cannot be read back and
transitively the writes would be guttered (but this is not a problem
because the write target address is not set by the memory location
of the write, it's actually set by the location specified in
the program command to the FLASH).

This means that the updating program has to be modified accordingly;
now, for writes, a single location is targeted (and as alluded above,
this is funneled to a write FIFO buffer, and then the actual address is
set with the page program command); and for readback, attempts to read
back the SoC area are flagged and noted as impossible due to security
precautions.
2022-04-22 02:48:43 +08:00
bunnie
b39f4c38eb fix update scripts so updates don't wipe root keys :-O 2022-04-20 17:15:46 +08:00
bunnie
9878dfc1a9 add a note about resetting the device properly after an update 2022-04-20 17:03:02 +08:00
bunnie
a31030bf90 remove excess wait state and clarify wait text 2022-04-20 16:59:19 +08:00
bunnie
15105cd0b2 fix update scripts to prevent device from self-resetting during updates 2022-04-20 16:57:10 +08:00
bunnie
4f9f1116fc fix various bugs in pddbg
note that there is still pddbg_v1 for the older version of the pddb
2022-04-20 03:47:17 +08:00
bunnie
758ed1ba31 some more fixes to pddbg to bring it up to v2. now passing CI. 2022-04-19 23:28:47 +08:00
bunnie
2d0af08266 bring pddbdbg up to v2 2022-04-19 15:57:51 +08:00
bunnie
d0f632965e add the old version of pddbg for debugging v1.x databases 2022-04-19 04:49:40 +08:00
bunnie
ba3639b00a prepare for v2 migration. more edits coming 2022-04-19 00:44:30 +08:00
bunnie
52f1afa780 commit some improvements to the CI framework 2022-03-31 00:28:49 +08:00
bunnie
e4eed87a55 Merge remote-tracking branch 'origin/main' into bunnie-dev 2022-03-29 16:45:56 +08:00
Aaron Bieber
6f98940189 Switch to using env to find the path to bash.
Systems like OpenBSD and NixOS have bash in different locations. This
allows the various scripts to be run on those systems.
2022-03-28 16:43:47 -06:00
bunnie
afb9974309 issue a warning if dup journal entries are found (pdddbg) 2022-03-29 04:37:35 +08:00
bunnie
0cf27be3b0 make the partition on dump vs ci analysis cleaner 2022-03-29 01:53:42 +08:00
bunnie
23041ab1f1 add a dump mode to pddbdbg.py so we can just view records
helpful for manual debugging
2022-03-29 01:47:00 +08:00
bunnie
c79afd4220 make sure the directory is not deleted 2022-03-28 04:09:57 +08:00
bunnie
6cbc93f8de make sure the directory is not deleted 2022-03-28 04:09:19 +08:00
bunnie
526a7374b0 re-introduce PDDB structure nuking on SoC reset 2022-03-20 15:25:14 +08:00
bunnie
b52b73ddfa add functionality to override the CSR data in case it is corrupted 2022-03-19 16:56:03 +08:00
bunnie
b06d7c4bb7 add a note about the hard reset 2022-03-19 16:31:37 +08:00
bunnie
1856a83e3e fix ordering of updates to prevent mid-update resets 2022-03-19 16:22:09 +08:00
bunnie
2aa72fae18
Update factory_reset.sh 2022-03-19 09:01:40 +08:00
bunnie
d9f4f6d041
Update factory_reset.ps1
move soc update to top so we don't get resets from latest xous
2022-03-19 09:00:58 +08:00
bunnie
eae61df786
Update factory_reset.sh
move soc update to the top to avoid wdt resets
2022-03-19 08:58:41 +08:00
bunnie
f7d42f6c1b correct usb_update.py force message to the correct version offsets 2022-03-18 17:39:45 +08:00
bunnie
dc2c393c5c update scripts to accept a locale argument 2022-03-10 16:22:48 +08:00
bunnie
dd017fb291 retire file-based versioning to symlink methodology 2022-02-28 16:06:48 +08:00
bunnie
2b3178be82 add a powershell script for bleeding edge CI
Because i don't know how to do variables in powershell :-/
2022-02-28 14:07:42 +08:00