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: 389d, last: 205d

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 773d 773d 0/22 auto-closed as invalid on 2020/09/14 09:18

Sample crash report:
BUG: sleeping function called from invalid context at kernel/printk/printk.c:2521
in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 6521, name: syz-executor083
3 locks held by syz-executor083/6521:
 #0: ffff88801cb28098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:252
 #1: ffff88801cb28468 (&tty->flow.lock){....}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:388 [inline]
 #1: ffff88801cb28468 (&tty->flow.lock){....}-{2:2}, at: n_tty_ioctl_helper+0xc1/0x2d0 drivers/tty/tty_ioctl.c:881
 #2: ffff88801cb28098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273
irq event stamp: 894
hardirqs last  enabled at (893): [<ffffffff81be5125>] kasan_quarantine_put+0xf5/0x210 mm/kasan/quarantine.c:220
hardirqs last disabled at (894): [<ffffffff89395b71>] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline]
hardirqs last disabled at (894): [<ffffffff89395b71>] _raw_spin_lock_irq+0x41/0x50 kernel/locking/spinlock.c:170
softirqs last  enabled at (0): [<ffffffff8144346c>] copy_process+0x1e8c/0x7590 kernel/fork.c:2139
softirqs last disabled at (0): [<0000000000000000>] 0x0
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 PID: 6521 Comm: syz-executor083 Not tainted 5.15.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 ___might_sleep.cold+0x1f3/0x239 kernel/sched/core.c:9539
 console_lock+0x19/0x80 kernel/printk/printk.c:2521
 do_con_write+0x10f/0x1e40 drivers/tty/vt/vt.c:2908
 con_write+0x21/0x40 drivers/tty/vt/vt.c:3295
 n_hdlc_send_frames+0x24b/0x490 drivers/tty/n_hdlc.c:290
 tty_wakeup+0xe1/0x120 drivers/tty/tty_io.c:534
 __start_tty drivers/tty/tty_io.c:806 [inline]
 __start_tty+0xfb/0x130 drivers/tty/tty_io.c:799
 n_tty_ioctl_helper+0x2a3/0x2d0 drivers/tty/tty_ioctl.c:884
 n_hdlc_tty_ioctl+0xe4/0x360 drivers/tty/n_hdlc.c:633
 tty_ioctl+0xc69/0x1670 drivers/tty/tty_io.c:2814
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fa09e007199
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 90 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:00007fffed48eff8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000000f4240 RCX: 00007fa09e007199
RDX: 0000000000000001 RSI: 000000000000540a RDI: 0000000000000005
RBP: 0000000000000000 R08: 000000000000000d R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000e3f9
R13: 00007fffed48f00c R14: 00007fffed48f020 R15: 00007fffed48f010

Crashes (19):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
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-kasan-gce-root 2021/12/07 02:39 upstream f80ef9e49fdf 0230ba3e .config log report info BUG: sleeping function called from invalid context in console_lock
ci-qemu-upstream 2021/12/05 19:07 upstream 79a72162048e a617004c .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-selinux-root 2021/12/03 22:56 upstream 5f58da2befa5 c7c20675 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-smack-root 2021/12/01 01:19 upstream f080815fdb3e 80270552 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-selinux-root 2021/11/30 16:17 upstream d58071a8a76d 80270552 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-selinux-root 2021/11/30 14:52 upstream d58071a8a76d 80270552 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-root 2021/11/28 05:07 upstream 741392771338 63eeac02 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-selinux-root 2021/09/27 03:25 upstream 996148ee05d0 78494d16 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-kasan-gce-smack-root 2021/09/20 21:50 upstream e4e737bb5c17 af796c18 .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-qemu-upstream-386 2021/12/05 23:46 upstream 944207047ca4 a617004c .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-linux-next-kasan-gce-root 2021/12/02 10:58 linux-next f81e94e91878 61f86278 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-linux-next-kasan-gce-root 2021/11/22 05:03 linux-next 5191249f8803 4eb20a4e .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-linux-next-kasan-gce-root 2021/11/17 14:01 linux-next fd96a4057bd0 cafff8b6 .config log report info BUG: sleeping function called from invalid context in console_lock
ci-upstream-linux-next-kasan-gce-root 2021/10/03 07:07 linux-next a25006a77348 db0f5787 .config log report info BUG: sleeping function called from invalid context in console_lock