aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/fault-injection/fault-injection.txt27
-rw-r--r--Documentation/fault-injection/notifier-error-inject.txt99
-rw-r--r--Documentation/printk-formats.txt15
-rw-r--r--Documentation/sysctl/fs.txt18
4 files changed, 153 insertions, 6 deletions
diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt
index ba4be8b77093..4cf1a2a6bd72 100644
--- a/Documentation/fault-injection/fault-injection.txt
+++ b/Documentation/fault-injection/fault-injection.txt
@@ -240,3 +240,30 @@ trap "echo 0 > /sys/kernel/debug/$FAILTYPE/probability" SIGINT SIGTERM EXIT
240echo "Injecting errors into the module $module... (interrupt to stop)" 240echo "Injecting errors into the module $module... (interrupt to stop)"
241sleep 1000000 241sleep 1000000
242 242
243Tool to run command with failslab or fail_page_alloc
244----------------------------------------------------
245In order to make it easier to accomplish the tasks mentioned above, we can use
246tools/testing/fault-injection/failcmd.sh. Please run a command
247"./tools/testing/fault-injection/failcmd.sh --help" for more information and
248see the following examples.
249
250Examples:
251
252Run a command "make -C tools/testing/selftests/ run_tests" with injecting slab
253allocation failure.
254
255 # ./tools/testing/fault-injection/failcmd.sh \
256 -- make -C tools/testing/selftests/ run_tests
257
258Same as above except to specify 100 times failures at most instead of one time
259at most by default.
260
261 # ./tools/testing/fault-injection/failcmd.sh --times=100 \
262 -- make -C tools/testing/selftests/ run_tests
263
264Same as above except to inject page allocation failure instead of slab
265allocation failure.
266
267 # env FAILCMD_TYPE=fail_page_alloc \
268 ./tools/testing/fault-injection/failcmd.sh --times=100 \
269 -- make -C tools/testing/selftests/ run_tests
diff --git a/Documentation/fault-injection/notifier-error-inject.txt b/Documentation/fault-injection/notifier-error-inject.txt
new file mode 100644
index 000000000000..c83526c364e5
--- /dev/null
+++ b/Documentation/fault-injection/notifier-error-inject.txt
@@ -0,0 +1,99 @@
1Notifier error injection
2========================
3
4Notifier error injection provides the ability to inject artifical errors to
5specified notifier chain callbacks. It is useful to test the error handling of
6notifier call chain failures which is rarely executed. There are kernel
7modules that can be used to test the following notifiers.
8
9 * CPU notifier
10 * PM notifier
11 * Memory hotplug notifier
12 * powerpc pSeries reconfig notifier
13
14CPU notifier error injection module
15-----------------------------------
16This feature can be used to test the error handling of the CPU notifiers by
17injecting artifical errors to CPU notifier chain callbacks.
18
19If the notifier call chain should be failed with some events notified, write
20the error code to debugfs interface
21/sys/kernel/debug/notifier-error-inject/cpu/actions/<notifier event>/error
22
23Possible CPU notifier events to be failed are:
24
25 * CPU_UP_PREPARE
26 * CPU_UP_PREPARE_FROZEN
27 * CPU_DOWN_PREPARE
28 * CPU_DOWN_PREPARE_FROZEN
29
30Example1: Inject CPU offline error (-1 == -EPERM)
31
32 # cd /sys/kernel/debug/notifier-error-inject/cpu
33 # echo -1 > actions/CPU_DOWN_PREPARE/error
34 # echo 0 > /sys/devices/system/cpu/cpu1/online
35 bash: echo: write error: Operation not permitted
36
37Example2: inject CPU online error (-2 == -ENOENT)
38
39 # echo -2 > actions/CPU_UP_PREPARE/error
40 # echo 1 > /sys/devices/system/cpu/cpu1/online
41 bash: echo: write error: No such file or directory
42
43PM notifier error injection module
44----------------------------------
45This feature is controlled through debugfs interface
46/sys/kernel/debug/notifier-error-inject/pm/actions/<notifier event>/error
47
48Possible PM notifier events to be failed are:
49
50 * PM_HIBERNATION_PREPARE
51 * PM_SUSPEND_PREPARE
52 * PM_RESTORE_PREPARE
53
54Example: Inject PM suspend error (-12 = -ENOMEM)
55
56 # cd /sys/kernel/debug/notifier-error-inject/pm/
57 # echo -12 > actions/PM_SUSPEND_PREPARE/error
58 # echo mem > /sys/power/state
59 bash: echo: write error: Cannot allocate memory
60
61Memory hotplug notifier error injection module
62----------------------------------------------
63This feature is controlled through debugfs interface
64/sys/kernel/debug/notifier-error-inject/memory/actions/<notifier event>/error
65
66Possible memory notifier events to be failed are:
67
68 * MEM_GOING_ONLINE
69 * MEM_GOING_OFFLINE
70
71Example: Inject memory hotplug offline error (-12 == -ENOMEM)
72
73 # cd /sys/kernel/debug/notifier-error-inject/memory
74 # echo -12 > actions/MEM_GOING_OFFLINE/error
75 # echo offline > /sys/devices/system/memory/memoryXXX/state
76 bash: echo: write error: Cannot allocate memory
77
78powerpc pSeries reconfig notifier error injection module
79--------------------------------------------------------
80This feature is controlled through debugfs interface
81/sys/kernel/debug/notifier-error-inject/pSeries-reconfig/actions/<notifier event>/error
82
83Possible pSeries reconfig notifier events to be failed are:
84
85 * PSERIES_RECONFIG_ADD
86 * PSERIES_RECONFIG_REMOVE
87 * PSERIES_DRCONF_MEM_ADD
88 * PSERIES_DRCONF_MEM_REMOVE
89
90For more usage examples
91-----------------------
92There are tools/testing/selftests using the notifier error injection features
93for CPU and memory notifiers.
94
95 * tools/testing/selftests/cpu-hotplug/on-off-test.sh
96 * tools/testing/selftests/memory-hotplug/on-off-test.sh
97
98These scripts first do simple online and offline tests and then do fault
99injection tests if notifier error injection module is available.
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index 5df176ed59b8..7561d7ed8e11 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -53,9 +53,20 @@ Struct Resources:
53 For printing struct resources. The 'R' and 'r' specifiers result in a 53 For printing struct resources. The 'R' and 'r' specifiers result in a
54 printed resource with ('R') or without ('r') a decoded flags member. 54 printed resource with ('R') or without ('r') a decoded flags member.
55 55
56Raw buffer as a hex string:
57 %*ph 00 01 02 ... 3f
58 %*phC 00:01:02: ... :3f
59 %*phD 00-01-02- ... -3f
60 %*phN 000102 ... 3f
61
62 For printing a small buffers (up to 64 bytes long) as a hex string with
63 certain separator. For the larger buffers consider to use
64 print_hex_dump().
65
56MAC/FDDI addresses: 66MAC/FDDI addresses:
57 67
58 %pM 00:01:02:03:04:05 68 %pM 00:01:02:03:04:05
69 %pMR 05:04:03:02:01:00
59 %pMF 00-01-02-03-04-05 70 %pMF 00-01-02-03-04-05
60 %pm 000102030405 71 %pm 000102030405
61 72
@@ -67,6 +78,10 @@ MAC/FDDI addresses:
67 the 'M' specifier to use dash ('-') separators instead of the default 78 the 'M' specifier to use dash ('-') separators instead of the default
68 separator. 79 separator.
69 80
81 For Bluetooth addresses the 'R' specifier shall be used after the 'M'
82 specifier to use reversed byte order suitable for visual interpretation
83 of Bluetooth addresses which are in the little endian order.
84
70IPv4 addresses: 85IPv4 addresses:
71 86
72 %pI4 1.2.3.4 87 %pI4 1.2.3.4
diff --git a/Documentation/sysctl/fs.txt b/Documentation/sysctl/fs.txt
index 13d6166d7a27..8c235b6e4246 100644
--- a/Documentation/sysctl/fs.txt
+++ b/Documentation/sysctl/fs.txt
@@ -163,16 +163,22 @@ This value can be used to query and set the core dump mode for setuid
163or otherwise protected/tainted binaries. The modes are 163or otherwise protected/tainted binaries. The modes are
164 164
1650 - (default) - traditional behaviour. Any process which has changed 1650 - (default) - traditional behaviour. Any process which has changed
166 privilege levels or is execute only will not be dumped 166 privilege levels or is execute only will not be dumped.
1671 - (debug) - all processes dump core when possible. The core dump is 1671 - (debug) - all processes dump core when possible. The core dump is
168 owned by the current user and no security is applied. This is 168 owned by the current user and no security is applied. This is
169 intended for system debugging situations only. Ptrace is unchecked. 169 intended for system debugging situations only. Ptrace is unchecked.
170 This is insecure as it allows regular users to examine the memory
171 contents of privileged processes.
1702 - (suidsafe) - any binary which normally would not be dumped is dumped 1722 - (suidsafe) - any binary which normally would not be dumped is dumped
171 readable by root only. This allows the end user to remove 173 anyway, but only if the "core_pattern" kernel sysctl is set to
172 such a dump but not access it directly. For security reasons 174 either a pipe handler or a fully qualified path. (For more details
173 core dumps in this mode will not overwrite one another or 175 on this limitation, see CVE-2006-2451.) This mode is appropriate
174 other files. This mode is appropriate when administrators are 176 when administrators are attempting to debug problems in a normal
175 attempting to debug problems in a normal environment. 177 environment, and either have a core dump pipe handler that knows
178 to treat privileged core dumps with care, or specific directory
179 defined for catching core dumps. If a core dump happens without
180 a pipe handler or fully qualifid path, a message will be emitted
181 to syslog warning about the lack of a correct setting.
176 182
177============================================================== 183==============================================================
178 184