All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Petr Mladek <pmladek@suse.com>,
	LKML <linux-kernel@vger.kernel.org>,
	syzkaller <syzkaller@googlegroups.com>
Subject: Re: [syzbot? printk?] no WARN_ON() messages printed before "Kernel panic - not syncing: panic_on_warn set ..."
Date: Thu, 9 May 2019 19:26:18 +0900	[thread overview]
Message-ID: <c7d1a923-a1cd-ca1e-e842-dd32b219c12f@i-love.sakura.ne.jp> (raw)
In-Reply-To: <20190509095823.GA23572@jagdpanzerIV>

On 2019/05/09 18:58, Sergey Senozhatsky wrote:
>> +#ifdef CONFIG_DEBUG_AID_FOR_SYZBOT
>> +static int initial_loglevel;
>> +static void check_loglevel(struct timer_list *timer)
>> +{
>> +	if (console_loglevel < initial_loglevel)
>> +		panic("Console loglevel changed (%d->%d)!", initial_loglevel,
>> +		      console_loglevel);
>> +	mod_timer(timer, jiffies + HZ);
>> +}
>> +static int __init loglevelcheck_init(void)
>> +{
>> +	static DEFINE_TIMER(timer, check_loglevel);
>> +
>> +	initial_loglevel = console_loglevel;
>> +	mod_timer(&timer, jiffies + HZ);
>> +	return 0;
>> +}
>> +late_initcall(loglevelcheck_init);
>> +#endif
> 
> I suppose this patch is for internal testing at Google only. I don't
> think we can consider upstreaming it.

Right. There is CONFIG_DEBUG_AID_FOR_SYZBOT option for testing at linux-next.git only.



> 
>> 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.

> 
> These are pr_info() level messages, but the text contains "WARNING: "
> 
> [..]
> pvr2_trace(PVR2_TRACE_ERROR_LEGS,
> 	   "WARNING: Detected a wedged cx25840 chip; the device will not work.");
> [..]
> 
> I would suggest to fix pvrusb2-i2c-core.c. I don't think we really
> want to $text =~ s/WARNING//g in printk.

Of course, I don't want to try $text =~ s/WARNING//g in printk().
What I meant is guard the callers like
https://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git/commit/?h=next-tomoyo&id=5c6b31e31adc31bd12636b196d3311f845dcc9d8
using a kernel config option which will be acceptable for upstreaming, for
we need to apply to all kernels which syzbot is testing.


  parent reply	other threads:[~2019-05-09 10:27 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-16  2:09 [syzbot? printk?] no WARN_ON() messages printed before "Kernel panic - not syncing: panic_on_warn set ..." 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
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 [this message]
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=c7d1a923-a1cd-ca1e-e842-dd32b219c12f@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=dvyukov@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.