mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	syzkaller <syzkaller@googlegroups.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [syzbot? printk?] no WARN_ON() messages printed before "Kernel panic - not syncing: panic_on_warn set ..."
Date: Sat, 16 Mar 2019 23:40:51 +0900	[thread overview]
Message-ID: <20190316144051.GB10815@tigerII.localdomain> (raw)
In-Reply-To: <CACT4Y+YEx5PF7QqaLdYpkyBCr_eBgp1n2yuY2LyrN9iZANXgzQ@mail.gmail.com>

On (03/16/19 15:16), Dmitry Vyukov wrote:
> > Hmm... sysctl, may be?
> >
> > > > I figured out that we should restrict it from doing
> > > > syslog(SYSLOG_ACTION_CONSOLE_OFF). And I also restricted its access o
> > > > /dev/console. But maybe there is something else? It _should_ not be
> > > > able to write to random sysctl's.
> > >
> > > Maybe try running with "ignore_loglevel" kernel command line option added?
> >
> > Right, that's something I would expect 0-day and syzkaller to do.
> 
> to double-check: enabling this won't lead to verbose/debug level of logging?

My bad, Saturday night.

You are right, this will make it very verbose. May be we can set
ignore_loglevel when we set loglevel to CONSOLE_LOGLEVEL_MOTORMOUTH.


Technically, we can have something like this

	CPU0						CPU1

	foo()						panic
	loglevel_save = console_loglevel
	....						console_verbose()
	console_loglevel = ABC
	....
	console_loglevel = loglevel_save		smp_send_stop()
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	killed
							console_flush_on_panic()
							// console is
							// NOT verbose


So we either can set ignore_loglevel in console_verbose(). Or call
call console_verbose() one more time, once we stopped other CPUs
and before we console_flush_on_panic().

---

diff --git a/kernel/panic.c b/kernel/panic.c
index 0ae0d7332f12..11784d37f625 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -263,6 +263,7 @@ void panic(const char *fmt, ...)
 	if (_crash_kexec_post_notifiers)
 		__crash_kexec(NULL);
 
+	console_verbose();
 #ifdef CONFIG_VT
 	unblank_screen();
 #endif

---

But I think that setting ignore_loglevel in console_verbose() is more
reliable.

	-ss

  reply	other threads:[~2019-03-16 14:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-16  2:09 Tetsuo Handa
2019-03-16  9:11 ` Dmitry Vyukov
2019-03-16 10:18   ` Tetsuo Handa
2019-03-16 14:14     ` Sergey Senozhatsky
2019-03-16 14:16       ` Dmitry Vyukov
2019-03-16 14:40         ` Sergey Senozhatsky [this message]
2019-03-16 14:53         ` Tetsuo Handa
2019-03-16 14:57           ` Dmitry Vyukov
2019-03-16 15:02             ` Tetsuo Handa
2019-03-16 15:10               ` Dmitry Vyukov
2019-03-18  5:27                 ` Tetsuo Handa
2019-03-18 12:07                   ` Dmitry Vyukov
2019-03-18 12:32                     ` Dmitry Vyukov
2019-03-18 12:39                       ` Dmitry Vyukov
2019-03-19  0:41                         ` Tetsuo Handa
2019-03-18 12:50                       ` Sergey Senozhatsky
2019-03-18 13:42                         ` Dmitry Vyukov
2019-03-18 14:09                           ` Sergey Senozhatsky
2019-03-19  8:10                             ` Dmitry Vyukov
2019-03-19 12:35                               ` Sergey Senozhatsky
2019-03-19 13:35                                 ` Dmitry Vyukov
2019-05-08 10:31                                   ` Tetsuo Handa
2019-05-09  9:58                                     ` Sergey Senozhatsky
2019-05-09 10:18                                       ` Sergey Senozhatsky
2019-05-09 10:40                                         ` Tetsuo Handa
2019-05-09 10:26                                       ` Tetsuo Handa
2019-05-09 10:36                                         ` Sergey Senozhatsky
2019-05-10 14:12                                     ` Petr Mladek
2019-05-10 14:53                                       ` Tetsuo Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190316144051.GB10815@tigerII.localdomain \
    --to=sergey.senozhatsky@gmail.com \
    --cc=dvyukov@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=syzkaller@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®