syzbot


BUG: sleeping function called from invalid context in console_lock (2)

Status: upstream: reported C repro on 2021/06/07 15:46
Reported-by: syzbot+dbac96d8e73b61aa559c@syzkaller.appspotmail.com
First crash: 552d, last: now

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: BUG: sleeping function called from invalid context in do_con_write (log)
Repro: C syz .config

Fix bisection: the fix commit could be any of (bisect log):
  614124bea77e Linux 5.13-rc5
  f55966571d5e Merge tag 'drm-next-2021-07-08-1' of git://anongit.freedesktop.org/drm/drm
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: sleeping function called from invalid context in console_lock 1 936d 936d 0/24 auto-closed as invalid on 2020/09/14 09:18
Patch testing requests:
Created Duration User Patch Repo Result
2022/12/08 01:59 13m zengheng4@huawei.com https://github.com/henryZe/linux.git fix_tty report log
2022/12/07 11:35 19m zengheng4@huawei.com https://github.com/henryZe/linux.git 4a1ce63ef555901ddc3e510a6f2371151c502cc6 error
2022/12/07 08:05 19m zengheng4@huawei.com https://github.com/henryZe/linux.git master error

Sample crash report:
BUG: sleeping function called from invalid context at kernel/printk/printk.c:2565
in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 3635, name: syz-executor421
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
3 locks held by syz-executor421/3635:
 #0: ffff88807c352098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x26/0x80 drivers/tty/tty_ldisc.c:244
 #1: ffff88807c352130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:944 [inline]
 #1: ffff88807c352130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:967 [inline]
 #1: ffff88807c352130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write.constprop.0+0x251/0x890 drivers/tty/tty_io.c:1089
 #2: ffff888145bae3e0 (&gsm->tx_lock){....}-{2:2}, at: gsmld_write+0x62/0x140 drivers/tty/n_gsm.c:3056
irq event stamp: 5012
hardirqs last  enabled at (5011): [<ffffffff89f07713>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline]
hardirqs last  enabled at (5011): [<ffffffff89f07713>] _raw_spin_unlock_irq+0x23/0x50 kernel/locking/spinlock.c:202
hardirqs last disabled at (5012): [<ffffffff89f07522>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline]
hardirqs last disabled at (5012): [<ffffffff89f07522>] _raw_spin_lock_irqsave+0x52/0x60 kernel/locking/spinlock.c:162
softirqs last  enabled at (4866): [<ffffffff814c1d03>] invoke_softirq kernel/softirq.c:445 [inline]
softirqs last  enabled at (4866): [<ffffffff814c1d03>] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650
softirqs last disabled at (4833): [<ffffffff814c1d03>] invoke_softirq kernel/softirq.c:445 [inline]
softirqs last disabled at (4833): [<ffffffff814c1d03>] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 PID: 3635 Comm: syz-executor421 Not tainted 6.1.0-rc7-syzkaller-00122-g355479c70a48 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106
 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9908
 console_lock+0x1b/0x80 kernel/printk/printk.c:2565
 do_con_write+0x10f/0x1e40 drivers/tty/vt/vt.c:2908
 con_write+0x25/0x40 drivers/tty/vt/vt.c:3295
 gsmld_write+0xcf/0x140 drivers/tty/n_gsm.c:3059
 do_tty_write drivers/tty/tty_io.c:1018 [inline]
 file_tty_write.constprop.0+0x452/0x890 drivers/tty/tty_io.c:1089
 call_write_iter include/linux/fs.h:2199 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x9ed/0xdd0 fs/read_write.c:584
 ksys_write+0x12b/0x250 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fdaa9b33289
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8da67ab8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fdaa9b33289

Crashes (380):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce 2022/12/02 14:08 upstream 355479c70a48 e080de16 .config log report syz C BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-smack-root 2022/11/27 16:50 upstream faf68e3523c2 74a66371 .config log report syz C BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-root 2021/10/30 12:02 upstream f25a5481af12 098b5d53 .config log report syz C BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2021/08/05 23:20 upstream 902e7f373fff d2d6e680 .config log report syz C BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2021/06/07 23:16 upstream 614124bea77e e59537be .config log report syz C BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2021/06/06 00:29 upstream e5220dd16778 500c2339 .config log report syz C BUG: sleeping function called from invalid context in console_lock
ci-upstream-linux-next-kasan-gce-root 2022/08/27 00:11 linux-next 8d0c42c9e807 e5a303f1 .config log report syz C BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/02 19:31 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e3cb714fb489 e080de16 .config log report syz C BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-selinux-root 2022/12/10 01:47 upstream 0d1409e4ff08 67be1ae7 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2022/12/08 23:06 upstream f3e8416619ce 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-selinux-root 2022/12/08 15:26 upstream 479174d402bc 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-root 2022/12/08 14:23 upstream 479174d402bc 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2022/12/08 13:19 upstream 479174d402bc 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2022/12/08 11:42 upstream 479174d402bc 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2022/12/08 04:23 upstream 479174d402bc d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-smack-root 2022/12/08 03:21 upstream 479174d402bc d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2022/12/08 01:28 upstream 479174d402bc d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2022/12/07 19:12 upstream 8ed710da2873 d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2022/12/07 13:47 upstream 8ed710da2873 d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2022/12/06 10:26 upstream bce9332220bd 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-selinux-root 2022/12/06 08:39 upstream bce9332220bd 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-qemu-upstream 2022/12/06 06:17 upstream bce9332220bd 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-qemu-upstream 2022/12/05 22:03 upstream 76dcd734eca2 dff7de3a .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2022/12/05 22:02 upstream 76dcd734eca2 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-selinux-root 2022/12/05 22:02 upstream 76dcd734eca2 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-selinux-root 2022/12/05 13:49 upstream 76dcd734eca2 e080de16 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce 2021/06/06 00:10 upstream e5220dd16778 500c2339 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-386 2022/12/09 17:44 upstream 0d1409e4ff08 67be1ae7 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-386 2022/12/09 11:32 upstream 0d1409e4ff08 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-386 2022/12/09 03:08 upstream f3e8416619ce 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-386 2022/12/09 00:19 upstream f3e8416619ce 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-386 2022/12/08 16:33 upstream 479174d402bc 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-386 2022/12/06 18:20 upstream bce9332220bd d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-386 2022/12/06 13:31 upstream bce9332220bd 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-386 2022/12/06 12:06 upstream bce9332220bd 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-qemu-upstream-386 2022/11/29 03:46 upstream b7b275e60bcd ca9683b8 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-linux-next-kasan-gce-root 2022/12/06 07:38 linux-next 9e46a7996732 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/09 15:30 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 67be1ae7 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/09 14:22 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 67be1ae7 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/09 12:52 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/09 10:08 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/09 01:32 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/08 22:05 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/08 21:04 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/08 10:41 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/08 09:12 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 1034e5fa .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/08 06:40 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/07 22:54 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/07 05:47 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/07 03:24 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/06 17:02 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/06 17:02 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/06 15:18 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 d88f3abb .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/05 18:13 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e3cb714fb489 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/05 16:03 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e3cb714fb489 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/05 14:51 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e3cb714fb489 045cbb84 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/05 07:33 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e3cb714fb489 e080de16 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/05 06:07 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e3cb714fb489 e080de16 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/05 05:04 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e3cb714fb489 e080de16 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/05 03:49 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e3cb714fb489 e080de16 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-gce-arm64 2022/12/04 15:15 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e3cb714fb489 e080de16 .config log report info BUG: sleeping function called from invalid context in console_lock
* Struck through repros no longer work on HEAD.