1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +00:00
serenity/Base/usr/share/man/man1/crash.md
Andreas Kling 9c0836ce97 Kernel: Enable x86 UMIP (User Mode Instruction Prevention) if supported
This prevents code running outside of kernel mode from using the
following instructions:

* SGDT - Store Global Descriptor Table
* SIDT - Store Interrupt Descriptor Table
* SLDT - Store Local Descriptor Table
* SMSW - Store Machine Status Word
* STR - Store Task Register

There's no need for userspace to be able to use these instructions so
let's just disable them to prevent information leakage.
2020-01-01 13:21:15 +01:00

1.4 KiB

Name

crash - intentionally perform an illegal operation

Synopsis

$ crash [options]

Description

This program is used to test how the Serenity kernel handles userspace crashes, and can be used to simulate many different kinds of crashes.

Options

  • -A: Test that all of the following crashes crash as intended.
  • -s: Perform a segmentation violation by dereferencing an invalid pointer.
  • -d: Perform a division by zero.
  • -i: Execute an illegal CPU instruction.
  • -a: Call abort().
  • -m: Read a pointer from uninitialized memory, then read from it.
  • -f: Read a pointer from memory freed using free(), then read from it.
  • -M: Read a pointer from uninitialized memory, then write to it.
  • -F: Read a pointer from memory freed using free(), then write to it.
  • -r: Write to read-only memory.
  • -T: Make a syscall while using an invalid stack pointer.
  • -t: Trigger a page fault while using an invalid stack pointer.
  • -S: Make a syscall from writeable memory.
  • -x: Read from recently freed memory. (Tests an opportunistic malloc guard.)
  • -y: Write to recently freed memory. (Tests an opportunistic malloc guard.)
  • -X: Attempt to execute non-executable memory. (Not mapped with PROT_EXEC.)
  • -U: Attempt to trigger an x86 User Mode Instruction Prevention fault.

Examples

$ crash -F
Testing: "Write to freed memory"
Shell: crash(33) exitied due to signal "Segmentation violation"