Re: [syzbot] [serial?] WARNING in register_console

Jiri Slaby <[email protected]> Fri, 7 Aug 2026 08:45:50 +0200
Newsgroups org.kernel.vger.linux-serial,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 06. 08. 26, 6:47, syzbot wrote:
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    0d8395707651 Merge tag 'soc-fixes-7.2-2' of git://git.kern..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=10883c99580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=cb17729fb04b1e3a
> dashboard link: https://syzkaller.appspot.com/bug?extid=1ebbc20f223b99446034
> compiler:       Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=15b1bbb9580000
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/14b35ca281d5/disk-0d839570.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/68c2ac2fdce0/vmlinux-0d839570.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/29bdd737b48f/bzImage-0d839570.xz
> mounted in repro: https://storage.googleapis.com/syzbot-assets/cce97dbb2265/mount_0.gz
>    fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=11da8e49580000)
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: [email protected]
> 
> printk: legacy console [ttyS0] enabled
> ------------[ cut here ]------------
> IS_ERR(kt)

Well, the creation of "pr/legacy" thread failed. Would be nice to see 
what is actual PTR_ERR(kt).

> WARNING: kernel/printk/printk.c:3728 at legacy_kthread_create kernel/printk/printk.c:3728 [inline], CPU#0: syz.4.49/6392
> WARNING: kernel/printk/printk.c:3728 at printk_kthreads_check_locked+0x2a7/0x3f0 kernel/printk/printk.c:3802, CPU#0: syz.4.49/6392
> Modules linked in:
> CPU: 0 UID: 0 PID: 6392 Comm: syz.4.49 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
> RIP: 0010:legacy_kthread_create kernel/printk/printk.c:3728 [inline]
> RIP: 0010:printk_kthreads_check_locked+0x2a7/0x3f0 kernel/printk/printk.c:3802
> Code: fe c1 38 c1 7c 9a 4c 89 f7 e8 c5 85 8a 00 eb 90 e8 7e 12 21 00 eb 05 e8 77 12 21 00 b0 01 88 05 2f a4 08 18 e9 e2 00 00 00 90 <0f> 0b 90 48 c7 c7 80 bd 6d 8b e8 1a 9f 82 ff 48 8b 1d 93 9e 04 18
> RSP: 0018:ffffc9000509fa70 EFLAGS: 00010206
> RAX: fffffffffffffffc RBX: 0000000000000001 RCX: 10959546c0351c00
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> RBP: ffffc9000509fb70 R08: ffff888032eb2daf R09: 1ffff110065d65b5
> R10: dffffc0000000000 R11: ffffed10065d65b6 R12: 0000000000000000
> R13: dffffc0000000000 R14: 1ffff92000a13f5c R15: dffffc0000000000
> FS:  00007f7f4a99d6c0(0000) GS:ffff888125c3e000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007fd99747f000 CR3: 000000003dd70000 CR4: 00000000003526f0
> Call Trace:
>   <TASK>
>   register_console+0xc19/0xfc0 kernel/printk/printk.c:4221
>   console_store+0x359/0x4f0 drivers/tty/serial/serial_core.c:2999

console_store() is serialized by a mutex. So this should not be a race. 
I cannot reproduce using:
while :; do
   echo 0 >/sys/class/tty/ttyS0/console
   echo 1 > /sys/class/tty/ttyS0/console
done

That's what the reproducer suggests is the cause.

thanks,
-- 
js
suse labs