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: <20190301041131.ypg6oaxhzyrgkkfu@shbuild888>
Date:   Fri, 1 Mar 2019 12:11:31 +0800
From:   Feng Tang <feng.tang@...el.com>
To:     Andrew Morton <akpm@...ux-foundation.org>,
        Petr Mladek <pmladek@...e.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Kees Cook <keescook@...omium.org>,
        Borislav Petkov <bp@...e.de>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Andi Kleen <ak@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jslaby@...e.com>, Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH v5] panic: Avoid the extra noise dmesg

Hi Andrew,

Thanks for the review!

On Thu, Feb 28, 2019 at 12:00:14PM -0800, Andrew Morton wrote:
> On Fri, 22 Feb 2019 14:09:59 +0800 Feng Tang <feng.tang@...el.com> wrote:
> 
> > When kernel panic happens, it will first print the panic call stack,
> > then the ending msg like:
> > 
> > [   35.743249] ---[ end Kernel panic - not syncing: Fatal exception
> > [   35.749975] ------------[ cut here ]------------
> > 
> > The above message are very useful for debugging.
> > 
> > But if system is configured to not reboot on panic, say the "panic_timeout"
> > parameter equals 0, it will likely print out many noisy message like
> > WARN() call stack for each and every CPU except the panic one, messages
> > like below:
> > 
> > 	WARNING: CPU: 1 PID: 280 at kernel/sched/core.c:1198 set_task_cpu+0x183/0x190
> > 	Call Trace:
> > 	<IRQ>
> > 	try_to_wake_up
> > 	default_wake_function
> > 	autoremove_wake_function
> > 	__wake_up_common
> > 	__wake_up_common_lock
> > 	__wake_up
> > 	wake_up_klogd_work_func
> > 	irq_work_run_list
> > 	irq_work_tick
> > 	update_process_times
> > 	tick_sched_timer
> > 	__hrtimer_run_queues
> > 	hrtimer_interrupt
> > 	smp_apic_timer_interrupt
> > 	apic_timer_interrupt
> 
> It's a fairly ugly-looking patch but I am inclined to agree.

Yes, it's ugly :) we've changed 3 methods to tackle this.

> The panicing CPU is spinning and blinking a LED and all CPUs have
> interrupts enabled and the system is known to be in a messed up state. 
> All sorts of kernel code could emit all sorts of output in such
> circumstances.  So a global printk-killing knob seems appropriate.
> 
> Thoughts:
> 
> - why do the suppression in vprintk_emit()?  Doing it right at entry
>   to printk() seems cleaner, more explicit?

Yes, I put it in printk() in one earlier post, and Petr suggested to
put it into vprintk_emit so that it works for all printk() interfaces,
like the devkmsg_write -> printk_emit -> vprintk_emit path.

> 
> - Other code sites may wish to suppress all printks.  Perhaps
>   `panic_suppress_printk' should just be called `suppress_printk'?
Ok, then I'll move the definition from panic.c to printk code.

Thanks,
Feng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ