oxicrypt-imageread 0.24.0

Kernel-mediated self-image reads for the pre-operational integrity test.
Documentation
  • Coverage
  • 100%
    9 out of 9 items documented0 out of 3 items with examples
  • Size
  • Source code size: 14.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 208.55 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • oxiforge/oxicrypt
    1 0 40
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • caraka

oxicrypt-imageread

Kernel-mediated reads of the module's own loaded image, for the pre-operational software integrity test.

oxicrypt-integrity keeps #![forbid(unsafe_code)]. On Linux and Android it can: the loaded image is reachable through /proc/self/mem or through the backing file, so every acquisition is an ordinary positioned file read and a wrong offset produces a short read rather than undefined behaviour.

Darwin and Windows offer no file-shaped route to a process's own memory. Reading the image there takes a system call, and a system call takes an extern declaration — so the declarations live here, in a crate that does nothing else.

Both mechanisms are kernel-mediated copies, and that is why they were chosen over a pointer read. The addresses come from a range table inside the artifact; a corrupt table can name an address that is not mapped. Dereferencing it would fault and take the process down — a denial of service triggered by exactly the malformed input the integrity test exists to detect. mach_vm_read_overwrite and ReadProcessMemory return a status instead, so an unreadable range becomes an error and the module enters its error state.

The crate compiles to a single NoMechanism stub on every other target, including Linux and Android, which need no exception.

License

See the repository root.