-
Notifications
You must be signed in to change notification settings - Fork 1
HOWTO: Testing CheriBSD
The testing of desktop operating systems is a difficult matter,
It isn't just one of your holiday games;
— Apologies to T.S. Eliot
This plan covers manual testing of a CheriBSD release image on an Arm Morello development board. Each section is a self-contained block of steps with a checklist; mark each box as you go and note any deviations in the Notes field at the bottom of the block.
Reference documents (read before starting):
- CheriBSD project home and downloads: https://www.cheribsd.org/
- Getting Started with CheriBSD (living document): https://ctsrd-cheri.github.io/cheribsd-getting-started/
- Current release notes: https://www.cheribsd.org/release-notes/25.03/index.html
- Morello known issues: https://ctsrd-cheri.github.io/cheribsd-getting-started/morello-issues/index.html
Test record header (fill in once, at the top of your test run log):
| Field | Value |
|---|---|
| CheriBSD release under test | e.g. 25.03
|
| Image filename | e.g. cheribsd-memstick-arm64-aarch64c-25.03.img
|
| Image SHA-256 | |
| Morello firmware revision | |
| Tester | |
| Test date | |
| Board serial / asset tag |
Before any of the test blocks below, you need a working Morello board, a workstation to write the USB image and drive the management console, and (for the full installation test and everything after it) an Internet connected network .
- Morello board powered and connected to the workstation via the management USB cable (see https://ctsrd-cheri.github.io/cheribsd-getting-started/morello-console/index.html).
- HDMI display attached to the board (required for Desktop Testing).
- USB keyboard and mouse attached to the board (required for Desktop Testing).
- Ethernet cable attached to the board and to a network that provides DHCP and outbound Internet access.
- At least one USB stick of 8 GiB or larger, dedicated to the installer image.
- Terminal emulator on the workstation that can speak to two USB serial
ports (e.g.
cu,tio,minicom,screen, PuTTY or Serial on macOS).
- Download the current installer image from the project home page: https://www.cheribsd.org/ — direct link for 25.03: https://download.cheribsd.org/releases/arm64/aarch64c/25.03/cheribsd-memstick-arm64-aarch64c-25.03.img.xz
- Record the file's SHA-256 in the header table above.
- Decompress:
unxz cheribsd-memstick-arm64-aarch64c-25.03.img.xz - Write to USB (substitute the correct device for
/dev/DISK):dd if=cheribsd-memstick-arm64-aarch64c-25.03.img of=/dev/DISK bs=1M conv=syncFull instructions: https://ctsrd-cheri.github.io/cheribsd-getting-started/morello-install/index.html
The Morello firmware must be reasonably current; older revisions have a bug that makes OS-triggered reboot unreliable, which will affect several test blocks below.
- Confirm firmware revision on the MCC console at power-on.
- If older than the latest published revision, upgrade using the procedure at https://ctsrd-cheri.github.io/cheribsd-getting-started/morello-firmware/index.html (firmware source: https://git.morello-project.org/morello/board-firmware.git).
- Re-record the firmware revision in the header table.
The goal of an installation test is to confirm that a new image can be fully installed, including both the Desktop Software and the Virtualization packages. A full installation test requires a working Internet connection so that the Desktop and Virtualization packages can be installed. An Image Only installation test requires only that you have the installation image on some form of removable media.
Instructions for how to obtain the installer image are in §0.2 above and at https://ctsrd-cheri.github.io/cheribsd-getting-started/downloading/index.html.
This block exercises the installer itself with no network dependency. It must be possible to complete this block on an air-gapped board.
- Disconnect the Ethernet cable from the board.
- Insert the prepared USB stick into one of the board's USB ports.
- Power the board on and observe MCC output on the management console.
- When prompted, press
Escapeon the system console to enter the UEFI boot menu. - Select Boot Manager and then the USB stick. Confirm that the CheriBSD boot loader is displayed and that the kernel boots without panics scrolling past.
- At the installer menu, select Install.
- Set the hostname (record value): __________________________________
- Select system components. Accept the defaults for an image-only test.
- Partition the internal disk using Auto (ZFS)
- Set the
rootpassword. - At the Network Configuration screen, Skip network setup.
- At the Desktop Environment prompt, answer No.
- At the CHERI VM Support prompt, answer No.
- Complete the installer and exit to live system (or reboot, see caveat below).
- Remove the USB stick before the post-install reboot, otherwise the installer will run again.
- If reboot hangs, type
rebooton the MCC console (see §0.3). - After reboot, log in as
rooton the serial console. - Run
uname -aand confirm the release string matches the image under test. Record output:
(paste uname -a here)
- Run
dmesg | grep -i panicanddmesg | grep -i error. Note anything unexpected.
Result: ☐ PASS ☐ FAIL ☐ BLOCKED
Notes:
The full test installs the system from the same image but with network access enabled and both add-on package sets selected.
- Reconnect Ethernet.
- Re-insert the USB stick and power-cycle the board.
- Enter the UEFI boot menu and boot the USB installer.
- Start a new install. Wipe the disk used in .
- Set the hostname, root password, and disk layout as in §1.1.
- At the Network Configuration screen, configure the wired interface
(
DHCPis normally correct). Record the assigned IP: __________________________________ - Confirm DNS resolution from the installer shell if available
(
Live CD→host www.cheribsd.org). - At the Desktop Environment prompt, answer Yes. The installer
will fetch the
cheri-desktoppackage set; expect this to take several minutes. - At the CHERI VM Support prompt, answer Yes. The installer will fetch the bhyve / VM support packages.
- Watch the installer log for
pkgfetch failures. If any package fails, record the package name and abort with FAIL. - Complete the installer, remove the USB stick, reboot.
- Log in as
rooton the serial console. - Confirm
cheri-desktopis installed:pkg64 info cheri-desktop - Confirm bhyve / VM packages installed:
pkg64 info | grep -i bhyve - Confirm
sddmis enabled in/etc/rc.confand that the graphical login screen appears on the HDMI output.
Result: ☐ PASS ☐ FAIL ☐ BLOCKED
Notes:
Prerequisite: §1.2 PASS. The desktop is a basic KDE/Wayland environment compiled for CheriABI, using the on-SoC Mali Bifrost GPU via Panfrost and DRM. Feature documentation: https://ctsrd-cheri.github.io/cheribsd-getting-started/features/desktop.html.
- On the HDMI display, the SDDM login greeter appears within 60 s of the multi-user boot completing.
- The greeter accepts the
rootpassword (or, preferred, a non-root user created during installation). - A KDE Plasma session starts and the panel renders without artifacts.
- Open and close a window (e.g. System Settings). Window decorations render correctly.
- Move, resize, minimize, maximize a window with the mouse.
- Switch between two open windows with
Alt+Tab. - Open a second virtual desktop and move a window to it.
- Launch Konsole. The shell prompt appears within 5 s.
- Run
uname -ainside Konsole and confirm CheriBSD kernel. - Run
procstat -ac $$to confirm the shell is a CheriABI process. - Launch Dolphin (file manager) and browse
/. - Launch the text editor (KWrite or Kate); open, edit, save a file in
/tmp.
The cheri-desktop-hybrid-extras package ships a hybrid-ABI Chromium for
24.05+; check pkg64 info before testing.
- Launch Chromium from the application menu.
- Load https://www.cheribsd.org/ and confirm the page renders.
- Load a JavaScript-heavy page (e.g. https://html5test.co/) and confirm no hard crash within 60 s.
- Log out of the KDE session and return to SDDM.
- From SDDM, request Shutdown. Board powers down cleanly (or hangs
due to the known firmware reboot bug — if so, note and use
rebooton the MCC console).
Result: ☐ PASS ☐ FAIL ☐ BLOCKED
Notes:
Prerequisite: §1.2 PASS with CHERI VM Support selected. CheriBSD ships an experimental CHERI-extended bhyve on Morello; see https://ctsrd-cheri.github.io/cheribsd-getting-started/features/bhyve.html.
-
kldstat | grep vmmshows thevmmmodule loaded (or loadable viakldload vmm). -
which bhyve bhyveload bhyvectl vmreturns paths for each. -
sysctl hw.vmmreturns at least one OID without error.
- Create a bridge and tap interface for the guest:
ifconfig tap0 create
sysctl net.link.tap.up_on_open=1
ifconfig bridge0 create
ifconfig bridge0 addm <ethernet-iface> addm tap0 up- Confirm the bridge is
upand learning addresses withifconfig.
Use the same memstick image used to install the host, or download a second
copy into /var/tmp on the host.
- Stage the guest image on the host:
cp /var/tmp/cheribsd-memstick-arm64-aarch64c-25.03.img /var/vm/guest.img - Launch bhyve (adjust device names as needed for your environment):
bhyve -c 2 -m 2G \
-s 0,hostbridge \
-s 1,virtio-blk,/var/vm/guest.img \
-s 2,virtio-net,tap0 \
-s 31,lpc \
-l com1,stdio \
cheri-guest- Confirm the guest kernel banner appears on the host's controlling terminal.
- Confirm the guest reaches a login prompt or installer menu.
- From the guest, run
uname -aand confirm a CheriBSD kernel. - From the guest, ping the host bridge address; confirm reachability.
- Destroy the guest cleanly:
bhyvectl --destroy --vm=cheri-guest.
- Re-launch the guest a second time without rebooting the host.
- After guest exit, host
dmesgshows novmmpanics or capability faults.
Result: ☐ PASS ☐ FAIL ☐ BLOCKED
Notes:
These blocks exercise CHERI-specific functionality that distinguishes CheriBSD from stock FreeBSD. Each is independent; pick the ones relevant to the release under test based on the release notes (https://www.cheribsd.org/release-notes/25.03/index.html).
Reference: https://ctsrd-cheri.github.io/cheribsd-getting-started/features/processes.html
-
ps -axo pid,comm,emul | headshows a mix offreebsd64andfreebsdcheriabiprocesses for a fresh boot. - Run a CheriABI hello-world. From the Getting Started guide, https://ctsrd-cheri.github.io/cheribsd-getting-started/helloworld/index.html:
cat > hello.c <<'EOF'
#include <stdio.h>
int main(void) { puts("hello, CHERI"); return 0; }
EOF
cc -o hello hello.c
file ./hello
./hello-
file ./helloreports a CheriABI binary by default; the program printshello, CHERI.
- Build and run a deliberately out-of-bounds test:
cat > oob.c <<'EOF'
#include <stdio.h>
#include <string.h>
int main(void) {
char buf[16];
char *p = buf;
p[32] = 'x'; /* out of bounds */
puts("should not get here");
return 0;
}
EOF
cc -o oob oob.c
./oob || echo "trapped as expected: $?"- The program is killed with a capability-related signal; the
should not get hereline does not appear. -
dmesg | tailshows a corresponding in-address-space capability fault diagnostic.
Reference: https://ctsrd-cheri.github.io/cheribsd-getting-started/features/temporal.html
- Confirm temporal safety is enabled for userspace by default
(
sysctl security.cheri.runtime_revocation_defaultreturns1on 25.03). - Build and run a use-after-free test:
cat > uaf.c <<'EOF'
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int *p = malloc(sizeof *p);
*p = 42;
free(p);
printf("%d\n", *p); /* use-after-free */
return 0;
}
EOF
cc -o uaf uaf.c
./uaf || echo "trapped as expected: $?"- The program is killed by the revoker rather than printing
42.
Reference: https://ctsrd-cheri.github.io/cheribsd-getting-started/features/c18n.html
- Confirm the c18n runtime is present:
ls /libexec/ld-elf-c18n.so.1. - Enable c18n globally for the session:
sysctl security.cheri.lib_based_c18n_default=1 - Re-run a non-trivial workload (e.g.
make buildworld-equivalent or simply re-launching the desktop session). Confirm it completes without spurious crashes. -
procstat compartments <pid>lists compartments for a running process. - Restore the previous value when done.
Reference: https://ctsrd-cheri.github.io/cheribsd-getting-started/packages/index.html
-
pkg64 updatesucceeds. -
pkg64 search nginxreturns at least one hit. -
pkg64 install -y curlinstalls andcurl --versionruns.
Only run this block if the host was installed with ZFS in §1.
-
zpool statusreportsONLINEwith no errors. -
zfs listshows the boot datasets. - Create, snapshot, and destroy a test dataset:
zfs create zroot/cheri-test
touch /zroot/cheri-test/x
zfs snapshot zroot/cheri-test@s1
zfs destroy -r zroot/cheri-test- All operations complete without error.
- From a serial session,
shutdown -p nowpowers the board off (or hangs at the syncer message due to the known firmware bug — if so, recover withrebooton the MCC console and record).
Result: ☐ PASS ☐ FAIL ☐ BLOCKED
Notes:
| Block | Result | Notes |
|---|---|---|
| 0. Prerequisites | ||
| 1.1 Image-Only installation | ||
| 1.2 Full installation | ||
| 2. Desktop | ||
| 3. Virtualization | ||
| 4.1 Process ABI | ||
| 4.2 Capability fault | ||
| 4.3 Temporal safety | ||
| 4.4 c18n | ||
| 4.5 Packages | ||
| 4.6 ZFS | ||
| 4.7 Shutdown |
Overall result: ☐ PASS ☐ FAIL ☐ BLOCKED
File issues against the CheriBSD GitHub repository: https://github.com/CTSRD-CHERI/cheribsd/issues. For test-plan or documentation issues, use: https://github.com/CTSRD-CHERI/cheribsd-getting-started/issues.