Prarit Bhargava
9e3961a097
kernel: add panic_on_warn
...
There have been several times where I have had to rebuild a kernel to
cause a panic when hitting a WARN() in the code in order to get a crash
dump from a system. Sometimes this is easy to do, other times (such as
in the case of a remote admin) it is not trivial to send new images to
the user.
A much easier method would be a switch to change the WARN() over to a
panic. This makes debugging easier in that I can now test the actual
image the WARN() was seen on and I do not have to engage in remote
debugging.
This patch adds a panic_on_warn kernel parameter and
/proc/sys/kernel/panic_on_warn calls panic() in the
warn_slowpath_common() path. The function will still print out the
location of the warning.
An example of the panic_on_warn output:
The first line below is from the WARN_ON() to output the WARN_ON()'s
location. After that the panic() output is displayed.
WARNING: CPU: 30 PID: 11698 at /home/prarit/dummy_module/dummy-module.c:25 init_dummy+0x1f/0x30 [dummy_module]()
Kernel panic - not syncing: panic_on_warn set ...
CPU: 30 PID: 11698 Comm: insmod Tainted: G W OE 3.17.0+ #57
Hardware name: Intel Corporation S2600CP/S2600CP, BIOS RMLSDP.86I.00.29.D696.1311111329 11/11/2013
0000000000000000 000000008e3f87df ffff88080f093c38 ffffffff81665190
0000000000000000 ffffffff818aea3d ffff88080f093cb8 ffffffff8165e2ec
ffffffff00000008 ffff88080f093cc8 ffff88080f093c68 000000008e3f87df
Call Trace:
[<ffffffff81665190>] dump_stack+0x46/0x58
[<ffffffff8165e2ec>] panic+0xd0/0x204
[<ffffffffa038e05f>] ? init_dummy+0x1f/0x30 [dummy_module]
[<ffffffff81076b90>] warn_slowpath_common+0xd0/0xd0
[<ffffffffa038e040>] ? dummy_greetings+0x40/0x40 [dummy_module]
[<ffffffff81076c8a>] warn_slowpath_null+0x1a/0x20
[<ffffffffa038e05f>] init_dummy+0x1f/0x30 [dummy_module]
[<ffffffff81002144>] do_one_initcall+0xd4/0x210
[<ffffffff811b52c2>] ? __vunmap+0xc2/0x110
[<ffffffff810f8889>] load_module+0x16a9/0x1b30
[<ffffffff810f3d30>] ? store_uevent+0x70/0x70
[<ffffffff810f49b9>] ? copy_module_from_fd.isra.44+0x129/0x180
[<ffffffff810f8ec6>] SyS_finit_module+0xa6/0xd0
[<ffffffff8166cf29>] system_call_fastpath+0x12/0x17
Successfully tested by me.
hpa said: There is another very valid use for this: many operators would
rather a machine shuts down than being potentially compromised either
functionally or security-wise.
Signed-off-by: Prarit Bhargava <prarit@redhat.com >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com >
Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com >
Cc: Fabian Frederick <fabf@skynet.be >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2014-12-10 17:41:10 -08:00
..
2012-10-13 10:46:49 +01:00
2013-04-23 13:25:51 -04:00
2014-07-15 09:34:19 +02:00
2013-09-08 14:34:22 -05:00
2013-04-08 06:53:15 -03:00
2014-09-23 23:15:46 -07:00
2012-11-09 16:28:37 -05:00
2012-10-09 09:48:44 +01:00
2012-10-09 09:48:45 +01:00
2012-10-11 17:27:54 -04:00
2014-10-07 20:16:31 +02:00
2014-08-20 15:13:08 +02:00
2014-06-25 19:28:43 +02:00
2014-06-25 19:28:43 +02:00
2013-04-02 12:25:57 +02:00
2014-08-18 15:12:14 -04:00
2014-10-14 13:08:29 +11:00
2014-02-27 13:51:29 +09:00
2012-10-09 09:49:04 +01:00
2014-01-16 17:24:11 -08:00
2012-10-09 09:49:06 +01:00
2014-09-16 09:58:21 -05:00
2013-08-02 12:33:54 -07:00
2012-10-13 10:46:48 +01:00
2013-03-13 15:21:48 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-03-13 15:21:48 -07:00
2014-01-07 13:50:28 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-10-19 16:25:56 -07:00
2012-10-13 10:46:48 +01:00
2013-02-08 20:42:18 +01:00
2013-04-26 16:08:16 +10:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-01-08 13:05:13 -08:00
2013-07-01 15:10:53 +02:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-10-14 16:06:45 -04:00
2014-10-14 16:06:45 -04:00
2012-10-13 10:46:48 +01:00
2014-07-01 10:48:05 -06:00
2014-06-28 13:48:44 -07:00
2014-05-19 09:38:24 +02:00
2014-04-22 21:42:27 -04:00
2014-03-20 14:55:18 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-01-21 15:40:35 -05:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-08-28 19:26:38 -07:00
2013-03-20 13:23:21 -04:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-03-15 12:12:36 -07:00
2013-06-25 15:50:04 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-07-30 17:21:05 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-11-19 12:31:17 -05:00
2014-01-21 23:46:27 -05:00
2014-01-23 16:36:55 -08:00
2013-08-20 16:53:58 -05:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-12-08 12:55:57 +08:00
2012-10-16 18:49:15 -07:00
2014-11-28 10:19:49 +00:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-08-05 16:35:54 -07:00
2014-10-06 01:04:16 -04:00
2013-12-03 15:35:52 +01:00
2012-10-13 10:46:48 +01:00
2014-03-13 19:07:42 +11:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-08-08 15:57:31 -07:00
2014-01-17 11:12:06 +01:00
2012-10-13 10:46:48 +01:00
2013-08-03 10:40:23 -07:00
2013-08-16 22:05:14 -04:00
2014-10-14 16:06:45 -04:00
2013-07-27 20:24:36 +02:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-10-03 16:53:33 -07:00
2014-10-24 00:14:37 +02:00
2012-10-13 10:46:48 +01:00
2014-07-22 16:37:43 +02:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-06-11 02:51:03 -07:00
2013-11-28 18:26:30 -05:00
2014-05-14 10:04:34 +01:00
2012-10-13 10:46:48 +01:00
2013-10-25 17:14:03 -04:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-11-03 23:20:14 -05:00
2012-11-19 22:21:03 +00:00
2014-09-23 23:31:21 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-07-09 16:41:36 -07:00
2012-10-13 10:46:48 +01:00
2013-09-03 22:11:44 -04:00
2014-01-15 17:00:40 -08:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-12-11 12:57:55 -08:00
2013-10-03 15:36:38 -04:00
2014-11-05 17:13:34 -05:00
2013-05-08 13:13:30 -07:00
2012-10-13 10:46:48 +01:00
2014-08-27 22:59:39 -07:00
2012-10-13 10:46:48 +01:00
2014-04-27 19:08:06 -04:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-09-29 15:37:01 -04:00
2012-10-13 10:46:48 +01:00
2014-07-29 11:39:50 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-08-13 15:10:22 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-08-21 12:21:45 -07:00
2014-10-03 16:53:33 -07:00
2013-02-10 20:37:22 -05:00
2012-10-13 10:46:48 +01:00
2014-02-27 15:59:09 -05:00
2012-10-13 10:46:48 +01:00
2014-08-06 15:25:01 -07:00
2012-10-13 10:46:48 +01:00
2014-02-26 15:51:00 -05:00
2014-09-29 00:13:10 -04:00
2012-10-13 10:46:48 +01:00
2014-10-20 21:03:58 +02:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-09-16 09:03:33 +09:00
2013-08-26 16:37:08 -04:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-02-27 19:10:21 -08:00
2012-10-13 10:46:48 +01:00
2012-11-16 01:47:40 -05:00
2014-07-01 12:16:24 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-17 12:31:15 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-12-04 15:28:40 -08:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-10-09 22:26:01 -04:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-08-08 15:57:32 -07:00
2012-10-13 10:46:48 +01:00
2013-09-24 10:35:19 +01:00
2014-05-30 21:01:11 +02:00
2014-09-17 13:10:08 +02:00
2014-05-23 16:28:53 -04:00
2014-04-03 16:21:06 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-11-11 21:56:51 -05:00
2013-11-06 23:32:59 -08:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-12-04 14:59:20 -02:00
2012-10-13 10:46:48 +01:00
2014-08-08 15:57:31 -07:00
2012-12-11 14:42:48 +00:00
2013-02-05 18:23:47 -02:00
2013-11-27 11:03:38 -08:00
2014-02-07 15:30:34 -08:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-12-14 13:05:23 +10:30
2014-03-04 13:51:06 -05:00
2014-01-20 14:45:33 -08:00
2013-01-21 13:55:14 -05:00
2013-01-21 13:55:14 -05:00
2013-07-09 10:33:25 -07:00
2014-01-20 14:44:50 -08:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-02-27 19:10:22 -08:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-06-02 17:58:55 -07:00
2012-10-13 10:46:48 +01:00
2014-08-05 16:35:54 -07:00
2012-10-13 10:46:48 +01:00
2013-12-22 18:02:43 -05:00
2014-07-15 16:12:01 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-01-07 23:57:25 +01:00
2013-11-28 18:16:43 -05:00
2013-04-19 14:57:57 -04:00
2012-10-13 10:46:48 +01:00
2014-05-20 00:06:04 +02:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-01-23 16:36:55 -08:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-10-28 15:37:56 -04:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-09-11 13:37:02 +02:00
2012-10-13 10:46:48 +01:00
2014-06-13 10:53:49 -04:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-11-16 10:15:35 -08:00
2014-10-06 00:32:21 -04:00
2013-11-28 18:16:43 -05:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-10-01 12:30:58 -06:00
2012-10-13 10:46:48 +01:00
2014-11-16 11:41:57 +01:00
2012-10-13 10:46:48 +01:00
2014-02-17 07:18:19 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-10-29 17:33:17 -04:00
2014-01-06 15:13:01 -05:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-01-23 16:36:55 -08:00
2012-10-13 10:46:48 +01:00
2014-11-18 00:58:53 +01:00
2014-04-30 04:18:57 -07:00
2014-03-21 14:21:13 -04:00
2013-07-03 16:08:01 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-08-05 16:41:22 -04:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-07-25 19:30:03 +10:00
2014-01-20 14:44:17 -08:00
2013-04-12 16:54:38 +02:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-06-19 23:06:51 -07:00
2012-10-13 10:46:48 +01:00
2014-11-16 10:58:53 +01:00
2012-10-13 10:46:48 +01:00
2014-07-16 14:40:04 -07:00
2012-10-13 10:46:48 +01:00
2014-07-18 12:13:40 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-09-08 16:12:40 -07:00
2014-07-17 18:23:35 -07:00
2012-10-13 10:46:48 +01:00
2014-07-20 14:33:23 -07:00
2014-06-06 16:08:14 -07:00
2012-12-19 18:07:39 -05:00
2012-10-13 10:46:48 +01:00
2014-08-21 15:25:11 -05:00
2014-03-03 15:58:03 -05:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-11-19 19:07:21 +00:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-12-06 01:22:31 +00:00
2012-10-13 10:46:48 +01:00
2014-12-10 17:41:10 -08:00
2012-10-13 10:46:48 +01:00
2014-10-03 11:15:20 -07:00
2012-10-13 10:46:48 +01:00
2014-02-26 17:08:40 -05:00
2014-02-14 16:09:43 -05:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-03-22 16:19:59 -07:00
2012-10-13 10:46:48 +01:00
2014-01-20 14:44:05 -08:00
2012-10-13 10:46:48 +01:00
2014-06-25 18:03:41 -07:00
2014-04-26 12:13:24 -04:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-05-23 16:28:53 -04:00
2014-08-25 03:28:08 -05:00
2014-07-21 14:30:42 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-11-28 18:16:43 -05:00
2014-03-04 15:38:05 -08:00
2014-08-25 10:40:06 -07:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-04-16 18:20:02 -03:00
2014-09-21 20:23:39 -03:00
2014-10-24 08:58:09 -02:00
2014-05-13 13:48:29 -03:00
2014-05-25 12:47:55 -03:00
2012-10-13 10:46:48 +01:00
2014-09-29 10:06:19 -06:00
2013-05-02 13:40:15 +03:00
2014-09-21 20:28:32 -03:00
2012-10-13 10:46:48 +01:00
2013-04-02 16:42:58 +10:30
2014-07-01 10:51:01 -06:00
2013-07-09 10:47:45 +09:30
2013-07-03 13:09:06 -07:00
2013-03-20 14:06:06 +10:30
2013-08-02 12:33:54 -07:00
2013-05-20 12:08:09 +09:30
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-03-08 12:24:48 -05:00
2013-12-11 09:25:20 -02:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2013-01-31 19:56:35 -05:00
2012-10-13 10:46:48 +01:00
2014-10-02 14:23:14 -04:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2012-10-13 10:46:48 +01:00
2014-08-29 16:28:16 -07:00
2014-09-02 13:37:56 +02:00
2013-11-26 11:09:08 +01:00
2013-11-26 11:09:09 +01:00