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: <20171016131305.GE6316@tigerII.localdomain>
Date:   Mon, 16 Oct 2017 22:13:05 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...nel.org>
Subject: Re: NMI watchdog dump does not print on hard lockup

Hello,

On (10/16/17 13:12), Petr Mladek wrote:
[..]
> > I think an NMI watchdog should just force the flush - the same way an
> > oops should. Deadlocks aren't really relevant if something doesn't get
> > printed out anyway.
> 
> We expicititely flush the NMI buffers in panic() when there is
> not other way to see them. But it is questional in other situations.
> Sometimes the flush might be the only way to see the messages
> and sometimes printk() might unnecessarily cause a deadlock.
> IMHO, the only solution is to make it optional.

just "brainstorming" it... with some silly ideas.

pushing the data from NMI panic might look like we are replacing one
deadlock scenario with another deadlock scenario. some of the console
drivers are soooo complex internally. so I have been thinking about...
may be we can extend struct console and add ->write_on_panic() and that
handler must be as lockless as possible; so lockless that calling it
from anything that is not panic() is a severe bug.

an absolutely trivial case,
if serial console does

	console_write_cb(struct console *co, const char *s, unsigned int count)
	{
		spin_lock_irqsave(&port->lock, flags);
		uart_console_write(s, count, console_putchar);
		spin_unlock_irqrestore(&port->lock, flags);
	}

then panic callback can look like

	console_write_on_panic_cb(struct console *co, const char *s, unsigned int count)
	{
		/* no, we don't take the port lock here */
		uart_console_write(s, count, console_putchar);
	}

a less trivial case might look more involved. but in general that
write_on_panic() callback must do the absolute minimum of work. so
it's sort of a early console, but as part of normal console driver.

I also got some other serial console crazy ideas, but they are not
related to this topic.

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ