lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190418105046.GA13459@jagdpanzerIV>
Date:   Thu, 18 Apr 2019 19:50:46 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Feng Tang <feng.tang@...el.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        linux-kernel@...r.kernel.org, Kees Cook <keescook@...omium.org>,
        Borislav Petkov <bp@...e.de>, ying.huang@...el.com
Subject: Re: [PATCH v2] panic: add an option to replay all the printk message
 in buffer

On (04/18/19 09:45), Petr Mladek wrote:
> The following functions are currently called from panic_print_sys_info():
> 
> + show_state():
> 	printk(KERN_INFO
> 		"  task                        PC stack   pid father\n");
> + show_mem():
> 	printk("Mem-Info:\n");
> 
> + sysrq_timer_list_show()
> 	no global header; but each section can be easily distinguished
> 	because there are several static strings that explains the
> 	content
> 
> + debug_show_all_locks()
> 	pr_warn("\nShowing all locks held in the system:\n");
> 
> + ftrace_dump():
> 	printk(KERN_TRACE "Dumping ftrace buffer:\n");

Oh, thanks.

> The person that enabled the debugging option might know what it did
> when it process the log the very same day. It might be less clear
> for others reading the log.
> 
> Also it still might be convenient to find the beginning easily.
> Or it might help to orientate when several test runs
> (over night test) are squashed in a single file. I see
> such logs pretty often.

OK, well since we are talking here about serial log, then we probably
can just add printk("dump logbuf:\n"). It will appear before the
FLUSH_ALL output. Or we can just tweak panic code a bit - anything
panic_print_sys_info() prints can be "after" end of panic marker.

Basically, just move pr_emerg("---[ end Kernel panic...") a bit. I don't
quite understand why is it at the bottom - we don't always print end of
panic maker, e.g. when panic_timeout != 0. Not sure if this was
intentional.

---
diff --git a/kernel/panic.c b/kernel/panic.c
index 50eacfc9bc7e..1940a142c26e 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -282,6 +282,7 @@ void panic(const char *fmt, ...)
 	 */
 	debug_locks_off();
 	console_flush_on_panic(CONSOLE_FLUSH_PENDING);
+	pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf);
 
 	panic_print_sys_info();
 
@@ -331,7 +332,6 @@ void panic(const char *fmt, ...)
 		disabled_wait(caller);
 	}
 #endif
-	pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf);
 
 	/* Do not scroll important messages printed above */
 	suppress_printk = 1;
---

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ