Merge tag 'v5.3-rc4' into next
[sfrench/cifs-2.6.git] / Documentation / fault-injection / provoke-crashes.rst
1 ===============
2 Provoke crashes
3 ===============
4
5 The lkdtm module provides an interface to crash or injure the kernel at
6 predefined crashpoints to evaluate the reliability of crash dumps obtained
7 using different dumping solutions. The module uses KPROBEs to instrument
8 crashing points, but can also crash the kernel directly without KRPOBE
9 support.
10
11
12 You can provide the way either through module arguments when inserting
13 the module, or through a debugfs interface.
14
15 Usage::
16
17         insmod lkdtm.ko [recur_count={>0}] cpoint_name=<> cpoint_type=<>
18                         [cpoint_count={>0}]
19
20 recur_count
21         Recursion level for the stack overflow test. Default is 10.
22
23 cpoint_name
24         Crash point where the kernel is to be crashed. It can be
25         one of INT_HARDWARE_ENTRY, INT_HW_IRQ_EN, INT_TASKLET_ENTRY,
26         FS_DEVRW, MEM_SWAPOUT, TIMERADD, SCSI_DISPATCH_CMD,
27         IDE_CORE_CP, DIRECT
28
29 cpoint_type
30         Indicates the action to be taken on hitting the crash point.
31         It can be one of PANIC, BUG, EXCEPTION, LOOP, OVERFLOW,
32         CORRUPT_STACK, UNALIGNED_LOAD_STORE_WRITE, OVERWRITE_ALLOCATION,
33         WRITE_AFTER_FREE,
34
35 cpoint_count
36         Indicates the number of times the crash point is to be hit
37         to trigger an action. The default is 10.
38
39 You can also induce failures by mounting debugfs and writing the type to
40 <mountpoint>/provoke-crash/<crashpoint>. E.g.::
41
42   mount -t debugfs debugfs /mnt
43   echo EXCEPTION > /mnt/provoke-crash/INT_HARDWARE_ENTRY
44
45
46 A special file is `DIRECT` which will induce the crash directly without
47 KPROBE instrumentation. This mode is the only one available when the module
48 is built on a kernel without KPROBEs support.