Commit a3dd3323058d281abd584b15ad4c5b65064d7a61

Authored by WANG Cong
Committed by Linus Torvalds
1 parent 9512938b88

kexec: remove KMSG_DUMP_KEXEC

KMSG_DUMP_KEXEC is useless because we already save kernel messages inside
/proc/vmcore, and it is unsafe to allow modules to do other stuffs in a
crash dump scenario.

[akpm@linux-foundation.org: fix powerpc build]
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Reported-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 5 changed files with 2 additions and 9 deletions Side-by-side Diff

arch/powerpc/platforms/pseries/nvram.c
... ... @@ -638,7 +638,6 @@
638 638 /* These are almost always orderly shutdowns. */
639 639 return;
640 640 case KMSG_DUMP_OOPS:
641   - case KMSG_DUMP_KEXEC:
642 641 break;
643 642 case KMSG_DUMP_PANIC:
644 643 panicking = true;
drivers/char/ramoops.c
... ... @@ -83,8 +83,7 @@
83 83 struct timeval timestamp;
84 84  
85 85 if (reason != KMSG_DUMP_OOPS &&
86   - reason != KMSG_DUMP_PANIC &&
87   - reason != KMSG_DUMP_KEXEC)
  86 + reason != KMSG_DUMP_PANIC)
88 87 return;
89 88  
90 89 /* Only dump oopses if dump_oops is set */
drivers/mtd/mtdoops.c
... ... @@ -315,8 +315,7 @@
315 315 char *dst;
316 316  
317 317 if (reason != KMSG_DUMP_OOPS &&
318   - reason != KMSG_DUMP_PANIC &&
319   - reason != KMSG_DUMP_KEXEC)
  318 + reason != KMSG_DUMP_PANIC)
320 319 return;
321 320  
322 321 /* Only dump oopses if dump_oops is set */
include/linux/kmsg_dump.h
... ... @@ -18,7 +18,6 @@
18 18 enum kmsg_dump_reason {
19 19 KMSG_DUMP_OOPS,
20 20 KMSG_DUMP_PANIC,
21   - KMSG_DUMP_KEXEC,
22 21 KMSG_DUMP_RESTART,
23 22 KMSG_DUMP_HALT,
24 23 KMSG_DUMP_POWEROFF,
... ... @@ -32,7 +32,6 @@
32 32 #include <linux/console.h>
33 33 #include <linux/vmalloc.h>
34 34 #include <linux/swap.h>
35   -#include <linux/kmsg_dump.h>
36 35 #include <linux/syscore_ops.h>
37 36  
38 37 #include <asm/page.h>
... ... @@ -1093,8 +1092,6 @@
1093 1092 if (mutex_trylock(&kexec_mutex)) {
1094 1093 if (kexec_crash_image) {
1095 1094 struct pt_regs fixed_regs;
1096   -
1097   - kmsg_dump(KMSG_DUMP_KEXEC);
1098 1095  
1099 1096 crash_setup_regs(&fixed_regs, regs);
1100 1097 crash_save_vmcoreinfo();