Hacking

Quick pinning CHERI source, good for both lib and kernel:

__has_feature(capabilities), used in sys/, bin/, lib/, libexec/, contrib/, include/, stand/, and *.h, *.c;

defined(__CHERI__), used in sys/, lib/, contrib/, and *.h, *.c, *.S;

Cheri Simulation:

Spike: https://github.com/CTSRD-CHERI/TestRIG

  • Cross
  • Reference 1 Cross-compiling for CheriBSD In order to cross-compile projects such as NGINX or PostgreSQL for CheriBSD you will first need a full SDK: cheribuild.py cheribsd-sdk. The you can then run cheribuild.py postgres-cheri or cheribuild.py nginx-mips, etc. By default these projects will be installed into your CheriBSD rootfs under /opt and will therefore be automatically included the next time you build a disk image. See cheribuild.py --list-targets for a full list of targets.

  • Sandbox_user
  • Error: seal violation when no ccall attributes Error: Could not print inside sandbox using default PCC/DCC Outside sandbox the printf function address is 0x4026,b0b0; Inside sandbox the printf function address is 0x401d,6ec0,0000,0000, which invalid address. Problem The problem comes out to be an issue of the calling convention. By default, functions are called by instruction jalr $t9, where t9 stores the entry address for the target function. When the target function is executed, the compiler still uses t9 to compute the address of variables and global functions, such as printf.

  • Hello
  • Hello World Makefile for cross compiling Execution in CheriBSD Error: relocation R_MIPS_HIGHEST cannot be used against local symbol; cheri-unknown-freebsd-ld: error: relocation R_MIPS_HIGHEST cannot be used against local symbol; recompile with -fPIC >>> defined in /root/cheri/output/rootfs-purecap128/usr/libcheri/libcheri.a(libcheri_invoke_cabi.o) >>> referenced by libcheri_invoke_cabi.S:156 (/root/cheri/cheribsd/lib/libcheri/mips/libcheri_invoke_cabi.S:156) >>> libcheri_invoke_cabi.o:(cheri_invoke) in archive /root/cheri/output/rootfs-purecap128/usr/libcheri/libcheri.a

Created Aug 7, 2019 // Last Updated May 18, 2021

If you could revise
the fundmental principles of
computer system design
to improve security...

... what would you change?