Re: [syzbot? printk?] no WARN_ON() messages printed before "Kernel panic - not syncing: panic_on_warn set ..."
From: Tetsuo Handa
Date: Thu May 09 2019 - 06:28:14 EST
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;
> 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.
>> ) 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: "
> "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
using a kernel config option which will be acceptable for upstreaming, for
we need to apply to all kernels which syzbot is testing.