mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] panic: call panic handlers before kmsg_dump
@ 2013-07-18 23:03 Kees Cook
  2013-07-18 23:17 ` Tony Luck
  0 siblings, 1 reply; 4+ messages in thread
From: Kees Cook @ 2013-07-18 23:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrew Morton, Anton Vorontsov, Colin Cross, Tony Luck,
	Stephen Boyd, Vikram Mulukutla, Peter Zijlstra, Rusty Russell

Since the panic handlers may produce additional information (via printk)
for the kernel log, it should be reported as part of the panic output
saved by kmsg_dump(). Without this re-ordering, nothing that adds
information to a panic will show up in pstore's view when kmsg_dump
runs, and is therefore not visible to crash reporting tools that examine
pstore output.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 kernel/panic.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 8018646..b6c482c 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -123,10 +123,14 @@ void panic(const char *fmt, ...)
 	 */
 	smp_send_stop();
 
-	kmsg_dump(KMSG_DUMP_PANIC);
-
+	/*
+	 * Run any panic handlers, including those that might need to
+	 * add information to the kmsg dump output.
+	 */
 	atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
 
+	kmsg_dump(KMSG_DUMP_PANIC);
+
 	bust_spinlocks(0);
 
 	if (!panic_blink)
-- 
1.7.9.5


-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] panic: call panic handlers before kmsg_dump
  2013-07-18 23:03 [PATCH] panic: call panic handlers before kmsg_dump Kees Cook
@ 2013-07-18 23:17 ` Tony Luck
  2013-09-10 22:41   ` Kees Cook
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Luck @ 2013-07-18 23:17 UTC (permalink / raw)
  To: Kees Cook
  Cc: Linux Kernel Mailing List, Andrew Morton, Anton Vorontsov,
	Colin Cross, Stephen Boyd, Vikram Mulukutla, Peter Zijlstra,
	Rusty Russell

On Thu, Jul 18, 2013 at 4:03 PM, Kees Cook <keescook@chromium.org> wrote:
> Since the panic handlers may produce additional information (via printk)
> for the kernel log, it should be reported as part of the panic output
> saved by kmsg_dump(). Without this re-ordering, nothing that adds
> information to a panic will show up in pstore's view when kmsg_dump
> runs, and is therefore not visible to crash reporting tools that examine
> pstore output.

Good point.

Acked-by: Tony Luck <tony.luck@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] panic: call panic handlers before kmsg_dump
  2013-07-18 23:17 ` Tony Luck
@ 2013-09-10 22:41   ` Kees Cook
  2013-09-10 22:44     ` Kees Cook
  0 siblings, 1 reply; 4+ messages in thread
From: Kees Cook @ 2013-09-10 22:41 UTC (permalink / raw)
  To: Andrew Morton, Tony Luck
  Cc: Linux Kernel Mailing List, Anton Vorontsov, Colin Cross,
	Stephen Boyd, Vikram Mulukutla, Peter Zijlstra, Rusty Russell

On Thu, Jul 18, 2013 at 4:17 PM, Tony Luck <tony.luck@gmail.com> wrote:
> On Thu, Jul 18, 2013 at 4:03 PM, Kees Cook <keescook@chromium.org> wrote:
>> Since the panic handlers may produce additional information (via printk)
>> for the kernel log, it should be reported as part of the panic output
>> saved by kmsg_dump(). Without this re-ordering, nothing that adds
>> information to a panic will show up in pstore's view when kmsg_dump
>> runs, and is therefore not visible to crash reporting tools that examine
>> pstore output.
>
> Good point.
>
> Acked-by: Tony Luck <tony.luck@intel.com>

Can someone pick this patch up? If akpm doesn't want it, it could live
in the pstore tree maybe?

-Kees

-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] panic: call panic handlers before kmsg_dump
  2013-09-10 22:41   ` Kees Cook
@ 2013-09-10 22:44     ` Kees Cook
  0 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2013-09-10 22:44 UTC (permalink / raw)
  To: Andrew Morton, Tony Luck
  Cc: Linux Kernel Mailing List, Anton Vorontsov, Colin Cross,
	Stephen Boyd, Vikram Mulukutla, Peter Zijlstra, Rusty Russell

On Tue, Sep 10, 2013 at 3:41 PM, Kees Cook <keescook@chromium.org> wrote:
> On Thu, Jul 18, 2013 at 4:17 PM, Tony Luck <tony.luck@gmail.com> wrote:
>> On Thu, Jul 18, 2013 at 4:03 PM, Kees Cook <keescook@chromium.org> wrote:
>>> Since the panic handlers may produce additional information (via printk)
>>> for the kernel log, it should be reported as part of the panic output
>>> saved by kmsg_dump(). Without this re-ordering, nothing that adds
>>> information to a panic will show up in pstore's view when kmsg_dump
>>> runs, and is therefore not visible to crash reporting tools that examine
>>> pstore output.
>>
>> Good point.
>>
>> Acked-by: Tony Luck <tony.luck@intel.com>
>
> Can someone pick this patch up? If akpm doesn't want it, it could live
> in the pstore tree maybe?

Ah, sorry, it seems like it is already in -mm. Never mind!

-Kees

-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-10 22:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-18 23:03 [PATCH] panic: call panic handlers before kmsg_dump Kees Cook
2013-07-18 23:17 ` Tony Luck
2013-09-10 22:41   ` Kees Cook
2013-09-10 22:44     ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®