Commit graph

10340 commits

Author SHA1 Message Date
Sean Cross
4d416ce4c6 Merge remote-tracking branch 'origin/main' into libstd-fs 2022-07-04 22:29:26 +08:00
bunnie
900e3e6ae2 fix limit on manual FSCB test so we're triggering basis gen once
it's pretty tedious to do repeated basis regens manually.
2022-07-04 18:35:18 +08:00
bunnie
10521bd9a7 bump release notes to include FSCB updates 2022-07-04 18:22:34 +08:00
bunnie
00a40ef29d Merge branch 'pddb' into main 2022-07-04 18:14:40 +08:00
bunnie
e26106e334 fix warnings and clean up configs
tighten up the scope of some features to reduce warning messages
2022-07-04 18:13:11 +08:00
bunnie
c46b5179ff commit various project configs 2022-07-04 17:58:52 +08:00
bunnie
8565c7efe1 fix FSCB generation issues
- fix problem where we were generating a size based off of total disk
size, instead of fraction of available space

- enumerate FSCB entries into the page table scan. This is because
the page table cache could hold used entries that aren't reflected
in the low-level disk scan, and there is no way to trigger a
flush at the point of re-allocation.
2022-07-04 17:56:54 +08:00
bunnie
608817f343 finalize/improve basis stress testing
- add an autotrigger feature for the basis stress test so it can
  be run in a fuzzer loop
- various fixes and improvements to the implementation to help
  integrate with CI
2022-07-04 17:55:52 +08:00
bunnie
5d23ad9db6 add the pddb-btest target, for secret basis stress testing 2022-07-04 17:55:23 +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
Sean Cross
c10541c0cc xous: definitions: fix discriminant shift for Results
The ServerID return type was placed in the middle of the results list,
which caused results 8-15 to be shifted by one to become results 9-15,
with result 8 being swapped with result 15.

This fixes this offset.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-07-04 16:54:32 +08:00
bunnie
baa5097313 fix basis FSCB generation on full - basic fix in place and tested 2022-07-04 15:19:40 +08:00
Sean Cross
e091a91f01
Merge pull request #199 from llange/fix-typo
Fix typo in the tool description : 'Rebide' -> 'Renode'
2022-07-04 09:22:27 +08:00
bunnie
66f7f0a5ab add the autobasis feature to the current xtask set 2022-07-04 04:08:55 +08:00
bunnie
7162b05a7f add routines for testing secret basis
When the "autobasis" feature is selected, the hardware block
will track all basis that have been opened and unlock them when
it comes time to scan/generate more FSCB space. It also bypasses
all UX normally invoked.

This allows us to create tests that open and close Bases automatically,
but of course, totally destroys the notion of plausible deniability.
So, don't turn the feature on for production.
2022-07-04 04:06:53 +08:00
bunnie
a977e9852d add a comprehensive secret basis tester 2022-07-04 04:04:39 +08:00
Ludovic LANGE
ea35ee832d
Fix typo in the tool description : 'Rebide' -> 'Renode'
As the REPL format comes from
[Renode Platform](https://github.com /renode/renode),
I believe the word 'Rebide' to be a typo for 'Renode'
(given the proximity of the letters on a keyboard).

Let's hope it'll make this tool more prominent in search results.

Signed-off-by: Ludovic LANGE <llange@users.noreply.github.com>
2022-07-03 21:57:00 +02:00
bunnie
41a144a7e0 add some more feedback to the fscbtest test 2022-07-03 01:13:48 +08:00
bunnie
8c5a475f49 some whitespace auto-changes 2022-07-03 01:13:31 +08:00
bunnie
8a81954cf0 clean up the page table enumeration
since all the keys are now disclosed, the routine has been
renamed accordingly and the re-scan of existing bases is
redundant.
2022-07-03 01:12:12 +08:00
bunnie
559229d85e fix key enumeration to include keys that we already know 2022-07-03 01:06:56 +08:00
bunnie
95055c30d7 add some whitespace formatting to improve readability of basis listing 2022-07-03 00:43:27 +08:00
bunnie
e8140f257c make sure the basis list is displayed at least once
need to cover the case that no enumeration was done, and just
show a "null" list confirming basically nothing other than
the system basis is disclosed.
2022-07-03 00:42:16 +08:00
bunnie
3992a45763 add a test case for "large" keys (128k datasets) 2022-07-03 00:36:49 +08:00
bunnie
b10cf878db fix large key read; and cursor positions in read() and write()
1. the large key read algorithm was broken. this is now fixed. we only
saw this triggered when the large key was much larger than 8kiB (and
the original CI tests just use 8kiB keys for "large").

2. the cursor position in read() and write() were being incremented
by the expected read amount, not the actual read amount.
2022-07-03 00:35:11 +08:00
bunnie
587f7ef39c some enhanced debugging 2022-07-02 00:09:38 +08:00
bunnie
ae37c2cd02 don't truncate key allocations that have an alloc_hint specified 2022-07-02 00:09:21 +08:00
bunnie
a1950a4c00 make a default alloc hint that's not 0
set to 8 bytes initially, could be adjusted up or down.
2022-07-01 19:45:55 +08:00
bunnie
5ba62df98d add a test routine for FSCB regeneration
this is meant to work with a reduced-size PDDB to trigger
fast space regen calls more rapidly.
2022-07-01 17:12:25 +08:00
bunnie
5008c7afac first draft of all basis unlock
This has worked in testing, but:

- There seems to be a new error unrelated to this with allocating
very large blocks of memory, which needs to be traced down.
- Because this operation will typically fully block the caller,
UX redraws can't happen (unless the caller has a fully multithreaded
redraw routine). This needs some thought because:

1. If you have several basis you're trying to unlock, eventually,
you'll overflow the application incoming queue with redraw requests,
and the system will crash.

2. It's cosmetically disturbing to have the dialog boxes piling up
on top of each other during a critical operation like this.

I *think* the right thing to do is to refactor the GAM a bit
to handle pop-up modals that block a bit more gracefully. But
I think it's more urgent to trace down the problem with large blocks
of memory being allocated, since it is a functional issue and not
a cosmetic one.
2022-07-01 17:09:51 +08:00
bunnie
0fc13100b1 make redraws non-catastrophic if the server queue is full 2022-07-01 17:09:33 +08:00
bunnie
a828b3e665 add "extension test" to the PDDB shellchat test command 2022-07-01 00:02:42 +08:00
bunnie
64e82d88dd fix hosted mode missing routine 2022-06-30 23:17:45 +08:00
bunnie
ead5bd7dac enable gateware updates when no root keys are present 2022-06-30 22:58:54 +08:00
bunnie
3aeec85e06 add a note about the overhead of the migration flag 2022-06-30 22:58:36 +08:00
Sean Cross
c9d5074dd2 kernel: riscv: use pointers for pagetable entries
Instead of passing a constructed mutable ref from the pagetable entry,
pass a raw pointer and use `read_volatile()` / `write_volatile(x)` on
this pointer.

This should remove a little bit of UB from the kernel.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-30 19:46:54 +08:00
Sean Cross
426fe4b91f kernel: riscv: don't crash when mapping invalid memory
Previously, the kernel would dutifully try to map memory that was in the
kernel space. It did this by investigating the kernel memory offset,
which immediately causes a double-fault.

Check to make sure a userspace process is not trying to map kernel
memory before checking the valid page.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-30 19:45:08 +08:00
Sean Cross
dcc964c3c1 kernel: riscv: use klog for memory exception printing
Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-30 19:44:06 +08:00
bunnie
f451cde9f9 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-06-29 13:24:45 +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
5edb286690
Merge pull request #197 from nworbnhoj/iter
Image processing as Adaptor Iterators
2022-06-29 12:48:21 +08:00
nworbnhoj
278f6e884d Merge branch 'iter' of github.com:nworbnhoj/xous-core into iter 2022-06-29 12:33:17 +10:00
nworbnhoj
bc2e4a4b2c tweak modals test clifford attractor generation 2022-06-29 12:32:58 +10:00
nworbnhoj
e7d5c11cbc
Merge branch 'main' into iter 2022-06-29 10:54:06 +10:00
nworbnhoj
247dfd2fe7 simplify gam bitmap img struct 2022-06-29 07:33:37 +10:00
bunnie
5d874ac0f3 when connecting to debug core, enable programming 2022-06-28 20:38:23 +08:00
bunnie
4fcc1ea173 bump pddb key listing limits
makes it a bit easier for debugging
2022-06-28 19:59:52 +08:00
bunnie
62372488df fix removing keys from FIDO2
I had put the fallback operation in the wrong arm of the match branch
2022-06-28 19:59:27 +08:00
bunnie
23a31c2cf0 fix PDDB initial stack size and increase heap limit on boot
I had thought there was an issue with heap size limit increases
and multithreading but I think actually the problem is the
PDDB runs pretty close to the stack size limit. This increases
the stack size limit for the PDDB on boot and also bumps up
the heap limit so caching can work more flawlessly.
2022-06-28 19:58:20 +08:00