Re: [lkp-robot] [include/linux/string.h] 6974f0c455: kernel_BUG_at_lib/string.c

From: Kees Cook
Date: Fri Jul 21 2017 - 01:48:09 EST


On Thu, Jul 20, 2017 at 6:59 PM, Ye Xiaolong <xiaolong.ye@xxxxxxxxx> wrote:
> On 07/19, Linus Torvalds wrote:
>>Hmm. I wonder why the kernel test robot ends up having that annoying
>>line doubling for the dmesg.
>>
>
> Hmm, this line doubling issue should be caused by we set both
> 'earlyprintk=ttyS0,115200' and 'console=ttyS0,115200' in cmdline, after I
> remove any of it, this issue is gone, is it an inappropriate setting?

This is a weird behavior. Normally the boot console (in this case
"earlyser0") should be disabled when the regular console starts. In
your dmesg I see:

[ 0.000000] bootconsole [earlyser0] enabled
...
[ 0.003333] console [ttyS0] enabled
[ 0.003333] console [ttyS0] enabled

This is where repeating starts, and I would have expected to see:

[ 0.000000] bootconsole [earlyser0] enabled
...
[ 0.000000] console [ttyS0] enabled
[ 0.000000] console [ttyS0] enabled
[ 0.000000] bootconsole [earlyser0] disabled
[ 0.000000] bootconsole [earlyser0] disabled

And that would be the end of doubling.

Actually, with your command-line ("earlyprintk=ttyS0,115200
console=ttyS0,115200 console=tty0") I would expect:

[ 0.000000] console [tty0] enabled
[ 0.000000] bootconsole [earlyser0] disabled
[ 0.000000] console [ttyS0] enabled

I don't see any mention of tty0, though. I wonder if that is confusing
the disable code. The only way I would normally expect the boot
console not to get unregistered is if ",keep" was appended to it...
The code is in kernel/printk/printk.c, FWIW.

Also, it looks like your kernel command line is cut off:

... earlyprintk=ttyS0,115200 console=ttyS0,115200 console=tty0 vga=

With your script showing "... vga=normal ..."

That's only 968 characters, well shy of x86's 2048 limit. Is this a
line length issue with qemu output, or does /proc/cmdline report the
same truncation?

-Kees

--
Kees Cook
Pixel Security