diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/fault-injection/fault-injection.txt | 27 | ||||
-rw-r--r-- | Documentation/fault-injection/notifier-error-inject.txt | 99 | ||||
-rw-r--r-- | Documentation/printk-formats.txt | 15 | ||||
-rw-r--r-- | Documentation/sysctl/fs.txt | 18 |
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 | |||
240 | echo "Injecting errors into the module $module... (interrupt to stop)" | 240 | echo "Injecting errors into the module $module... (interrupt to stop)" |
241 | sleep 1000000 | 241 | sleep 1000000 |
242 | 242 | ||
243 | Tool to run command with failslab or fail_page_alloc | ||
244 | ---------------------------------------------------- | ||
245 | In order to make it easier to accomplish the tasks mentioned above, we can use | ||
246 | tools/testing/fault-injection/failcmd.sh. Please run a command | ||
247 | "./tools/testing/fault-injection/failcmd.sh --help" for more information and | ||
248 | see the following examples. | ||
249 | |||
250 | Examples: | ||
251 | |||
252 | Run a command "make -C tools/testing/selftests/ run_tests" with injecting slab | ||
253 | allocation failure. | ||
254 | |||
255 | # ./tools/testing/fault-injection/failcmd.sh \ | ||
256 | -- make -C tools/testing/selftests/ run_tests | ||
257 | |||
258 | Same as above except to specify 100 times failures at most instead of one time | ||
259 | at most by default. | ||
260 | |||
261 | # ./tools/testing/fault-injection/failcmd.sh --times=100 \ | ||
262 | -- make -C tools/testing/selftests/ run_tests | ||
263 | |||
264 | Same as above except to inject page allocation failure instead of slab | ||
265 | allocation 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 @@ | |||
1 | Notifier error injection | ||
2 | ======================== | ||
3 | |||
4 | Notifier error injection provides the ability to inject artifical errors to | ||
5 | specified notifier chain callbacks. It is useful to test the error handling of | ||
6 | notifier call chain failures which is rarely executed. There are kernel | ||
7 | modules 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 | |||
14 | CPU notifier error injection module | ||
15 | ----------------------------------- | ||
16 | This feature can be used to test the error handling of the CPU notifiers by | ||
17 | injecting artifical errors to CPU notifier chain callbacks. | ||
18 | |||
19 | If the notifier call chain should be failed with some events notified, write | ||
20 | the error code to debugfs interface | ||
21 | /sys/kernel/debug/notifier-error-inject/cpu/actions/<notifier event>/error | ||
22 | |||
23 | Possible 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 | |||
30 | Example1: 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 | |||
37 | Example2: 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 | |||
43 | PM notifier error injection module | ||
44 | ---------------------------------- | ||
45 | This feature is controlled through debugfs interface | ||
46 | /sys/kernel/debug/notifier-error-inject/pm/actions/<notifier event>/error | ||
47 | |||
48 | Possible PM notifier events to be failed are: | ||
49 | |||
50 | * PM_HIBERNATION_PREPARE | ||
51 | * PM_SUSPEND_PREPARE | ||
52 | * PM_RESTORE_PREPARE | ||
53 | |||
54 | Example: 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 | |||
61 | Memory hotplug notifier error injection module | ||
62 | ---------------------------------------------- | ||
63 | This feature is controlled through debugfs interface | ||
64 | /sys/kernel/debug/notifier-error-inject/memory/actions/<notifier event>/error | ||
65 | |||
66 | Possible memory notifier events to be failed are: | ||
67 | |||
68 | * MEM_GOING_ONLINE | ||
69 | * MEM_GOING_OFFLINE | ||
70 | |||
71 | Example: 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 | |||
78 | powerpc pSeries reconfig notifier error injection module | ||
79 | -------------------------------------------------------- | ||
80 | This feature is controlled through debugfs interface | ||
81 | /sys/kernel/debug/notifier-error-inject/pSeries-reconfig/actions/<notifier event>/error | ||
82 | |||
83 | Possible 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 | |||
90 | For more usage examples | ||
91 | ----------------------- | ||
92 | There are tools/testing/selftests using the notifier error injection features | ||
93 | for 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 | |||
98 | These scripts first do simple online and offline tests and then do fault | ||
99 | injection 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 | ||
56 | Raw 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 | |||
56 | MAC/FDDI addresses: | 66 | MAC/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 | |||
70 | IPv4 addresses: | 85 | IPv4 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 | |||
163 | or otherwise protected/tainted binaries. The modes are | 163 | or otherwise protected/tainted binaries. The modes are |
164 | 164 | ||
165 | 0 - (default) - traditional behaviour. Any process which has changed | 165 | 0 - (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. |
167 | 1 - (debug) - all processes dump core when possible. The core dump is | 167 | 1 - (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. | ||
170 | 2 - (suidsafe) - any binary which normally would not be dumped is dumped | 172 | 2 - (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 | ||