Re: [syzbot? printk?] no WARN_ON() messages printed before "Kernel panic - not syncing: panic_on_warn set ..."

From: Sergey Senozhatsky
Date: Thu May 09 2019 - 06:37:37 EST


On (05/09/19 19:26), Tetsuo Handa wrote:
> >> By the way, recently we are hitting false positives caused by "WARNING:"
> >> string from not WARN() messages but plain printk() messages (e.g.
> >>
> >> https://syzkaller.appspot.com/bug?id=31bdef63e48688854fde93e6edf390922b70f8a4
> >> https://syzkaller.appspot.com/bug?id=faae4720a75cadb8cd0dbda5c4d3542228d37340
> >>
> >> ) and we need to avoid emitting "WARNING:" string from plain printk() messages
> >> during fuzzing testing. I guess we want to add something like
> >> CONFIG_DEBUG_AID_FOR_SYZBOT to all kernels in order to mask such string...
> >
> > I thought that we have MSG_FORMAT_SYSLOG exactly for things like these,
> > so you can look at actual message level <%d> and then decide if it's a
> > warning or a false alarm.
>
> Since syzbot needs to use console output, message level is not available.

Sorry, not following. MSG_FORMAT_SYSLOG should add message level
to console output. Booting the kernel with console_msg_format=syslog
will change msg_print_text() behaviour, and you'll get on your serial
console messages in

<print_syslog>[print_time][print_caller] message text\n

format.

Does this work for you?

-ss