Commit graph

118 commits

Author SHA1 Message Date
bunnie
5370ce396d bump all revs due to SoC artifact update 2022-12-12 16:07:20 +08:00
bunnie
1d1b3a35b7 commit version bump 2022-11-26 10:00:44 +08:00
bunnie
aa9977cc58 bump all the things because we changed utralib again 2022-11-17 22:13:40 +08:00
bunnie
dabbfd6c35 bump all the things to absorb the SoC change 2022-11-17 19:39:18 +08:00
Sean Cross
3a8457852f loader: fix build with gcc-ld
With Rust 1.65.0, we may be forced to use gdb's linker due to bug that
appeared in llvm-15:

https://github.com/rust-lang/rust/issues/103949

Signed-off-by: Sean Cross <sean@xobs.io>
2022-11-04 12:26:05 +08:00
Tom Marble
9689b3bc07
Removes VS Code artifacts
Also updates .gitignore to prevent adding IDE (VS Code, Emacs) artifacts

Signed-off-by: Tom Marble <tmarble@info9.net>
2022-10-28 11:23:56 -05:00
bunnie
ba28dd8795 bump to absorb utralib straggler configs 2022-10-28 15:11:17 +08:00
bunnie
475e464efe bump versions due to svd2utra change 2022-10-27 03:04:22 +08:00
bunnie
d331d405ee bump version numbers for publication 2022-10-25 17:23:40 +08:00
bunnie
805a7d528c flip back to using remote references 2022-10-20 16:30:06 +08:00
Sean Cross
b35d65c3e1 loader: skip zeroing when we hit a page boundary
Previously, we would unconditionally zero out the remainder of a page
when finished copying. We wrapped to PAGE_SIZE in order to avoid
corrupting another process' memory.

However, an issue was discovered under the following circumstances:

    1. There are fewer than 4096 bytes of `.bss`
    2. The `.bss` ends on a page boundary

Under these conditions, the loader would load the section before the
`.bss` into the page, then clear out the `.bss`, and finally clear the
entire page, overwriting the previous section.

Skip the remainder-of-page clearout when the `.bss` ends on a page
boundary, rather than clearing the entire page.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-10-20 11:27:48 +08:00
Sean Cross
af501c4303 loader: print process IDs as debug data
Print out the current process ID when looping through values. This will
make it easier to identify which process is getting loaded when reading
through the tea leaves.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-10-20 11:27:48 +08:00
bunnie
8e05925cfa somehow the transition to local paths got missed in the merge 2022-10-18 00:39:01 +08:00
bunnie
0584ad2f2c switch to local paths to see if this helps the build 2022-10-18 00:26:56 +08:00
bunnie
12dc1e6b70 more patches for local build 2022-10-17 23:34:47 +08:00
bunnie
4b368d71db bump versions of crates 2022-10-15 01:31:54 +08:00
bunnie
63a87ca1bc bump all the versions 2022-10-14 16:54:43 +08:00
bunnie
18e1d6e867 switch over to the log uart on boot
this helps minimal configurations to be more useful without pulling
in com/llio crates. The trade-off is that KP's early in boot
(or during resume) are not visible, but, these are (thankfully??)
less rare these days.
2022-10-02 21:45:36 +08:00
bunnie
fb29c9b2c1 refactor utra target line to use explicit feature targets
still need to rework the crate feature selection
2022-10-02 02:20:03 +08:00
bunnie
6e6b846341 fix default-features setting in loader 2022-09-27 02:44:27 +08:00
bunnie
e32ea4d3f5 fix #174 2022-06-10 21:36:53 +08:00
Sean Cross
2e69ae8a12 spawn: compiles, but does not work yet
Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-28 05:10:48 +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
b50dbf0a69 silence a warning in the loader module about an unused macro 2022-03-22 22:18:40 +08:00
Sean Cross
a70aee7bad loader: move loader into main workspace
Add the loader into the main workspace, removing it from its own
sub-workspace. We can do this now that we can specify the linker script
in `build.rs`.

This improves IDE support, and should shrink disk storage requirements.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-22 02:09:18 +08:00
bunnie
4f65fe522f fix debug print locations for loader 2022-03-14 01:19:38 +08:00
bunnie
e7efb14bdf add a bypass for Renode to skip the signature check
- bypass causes warnings to be emitted in compilation
- stark visual change on boot screen ("jail bars" instead of gray on bottom half)
- root keys are locked out permanently from readout
- devboot canary set
2022-03-02 19:51:16 +08:00
bunnie
f2eb466965 bump loader version string 2022-02-04 03:22:35 +08:00
bunnie
6d6b62ae60 add routine to lock keys if loader cannot verify kernel
Doesn't do enough to protect against glitch attacks but at least
it narrows the window where the keys are trivially readable if
code exec is achieved.
2022-02-03 22:01:24 +08:00
bunnie
afd525002d initial attempt to move the font resources into the loader 2022-01-23 03:23:06 +08:00
bunnie
797e5bd7c4 follow-on set of commits related to the previous revert 2022-01-17 23:52:58 +08:00
bunnie
0d4ab0eb47 Revert "loader: move loader into main workspace"
This reverts commit 0d72454776.
2022-01-17 22:55:39 +08:00
bunnie
80bf673731 massage the loader to work
however -- it is now very slow
2022-01-17 01:10:41 +08:00
bunnie
e8e389552f add map generation to the loaders 2022-01-17 00:04:03 +08:00
Sean Cross
0d72454776 loader: move loader into main workspace
Add the loader into the main workspace, removing it from its own
sub-workspace. We can do this now that we can specify the linker script
in `build.rs`.

This improves IDE support, and should shrink disk storage requirements.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-01-14 17:32:04 +08:00
bunnie
b3788a54af clarify the dependency policy 2022-01-10 16:50:10 +08:00
bunnie
995915ed4e nail down a couple more dependencies, and add a policy note to Cargo.toml
Each Cargo.toml now includes a comment which remnids maintainers
of the dependency policy for Xous (that is, nail down every dependency
to the minor number).
2022-01-10 15:54:27 +08:00
bunnie
fec180890b nail down dependencies in the related build toolchain flow
these are secondary attack surfaces -- code that isn't directly
in the kernel, but involved in the manipulation, handling, grooming
and preparation of source and binary files
2022-01-10 15:49:30 +08:00
bunnie
dd943c5416 pin down versions and harmonize versions across servers
Versions are pinned down to the minor number. Yes, this means that
we don't automatically pull in features and bug updates from crates.io,
but it also means we don't pull in new attack surfaces and code that
hasn't been tested or reviewed. I'd like this process to be very deliberate
and not automatic for Xous.

The `rand` crate is almost pinned down to a single version, except
for an odd dependency that's pulled in by hosted mode that depends
on rand 0.8.4 via a subordinate dependency via the `tempfile` crate.
Pondering if it's worth it to try and eliminate that, because the
0.8.4 version doesn't get compiled into any version that touches
real hardware. It just makes it harder to analyze the Cargo.lock
file, mostly. I think I'll leave it as-is.
2022-01-10 15:39:55 +08:00
bunnie
3f4fea1274 clean up some easy warnings 2022-01-07 22:19:39 +08:00
bunnie
fe04f5684f fix a critical bug that prevents root key initialization
This is going to require users to update their devices before
doing a key initialization.

The problem is that we can't trust the length of data presented
to us to self-sign, so we sign the whole area. In v0.9.2 of the
loader, a check was introduced to check the putative length of
the signed area against the actual length of the signed area,
by encoding the length of the signed area within the signed
region.

This would require the rootkeys algorithm to also encode that
new length at the end of the signed area, but this was never
done. However, this bug was never found during testing probably
because I failed to completely erase the original key provisioning
(I was more fixated on checking that existing keys were not damaged by
firmware updates at the time), and thus did not trigger a full
rootkey provisioning cycle when I did the test. I had only just
caught it now while porting the PDDB from simulation to real
hardware.
2022-01-03 19:06:21 +08:00
bunnie
337afbbe47 bump loader version number 2021-11-02 03:26:16 +08:00
bunnie
8d501cfcc6 add a check that the detached signature metadata matches signed data
the unsigned metadata in the signature header is used to compute
the signature, which contains a copy of the key metadata. We forgot
to make sure these match, which means the signed copy was worthless.

Until now.
2021-11-02 03:16:40 +08:00
bunnie
010856406d fix permissions 2021-10-27 23:06:13 +08:00
bunnie
3a4bbdd71a fix permissions. windows likes to make all files executable! world writeable! 2021-10-23 18:37:39 +08:00
bunnie
dc527a3619 Rust 1.56 results in a bigger loader. Presumably because "optimization".
This causes the font maps to shift down. Allocate some "room to grow"
as Rust gets more "optimal".
2021-10-23 18:36:31 +08:00
bunnie
16fdd25839 fix new compiler warnings since rust 1.55 re: workspace issues 2021-09-10 22:54:01 +08:00
bunnie
e2ce3cad2c make sure that the power states get set correctly early in the resume process 2021-08-27 15:47:27 +08:00
bunnie
98afa19264 fix kernel uart going dead after suspend/resume 2021-08-24 03:46:02 +08:00
bunnie
abd8eadfd8 modify the console behavior to better capture panics on resume
switches to kernel console on suspend, keeps it in kernel
console on resume for a few hundred ms before switching back
to our original setting
2021-08-22 14:28:06 +08:00