[v6.1] BUG: sleeping function called from invalid context in console_lock

7 views
Skip to first unread message

syzbot

unread,
Mar 20, 2023, 6:28:38 AM3/20/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7eaef76fbc46 Linux 6.1.20
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10b1f4f6c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=29ad3fe3c7b61175
dashboard link: https://syzkaller.appspot.com/bug?extid=3b4e5a312b4a72ffb261
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/34f95428f5fb/disk-7eaef76f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1bdd9b2c390d/vmlinux-7eaef76f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/419140981cfa/Image-7eaef76f.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3b4e5a...@syzkaller.appspotmail.com

BUG: sleeping function called from invalid context at kernel/printk/printk.c:2565
in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 10302, name: syz-executor.4
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
3 locks held by syz-executor.4/10302:
#0: ffff0000d0e5c098 (&tty->ldisc_sem){++++}-{0:0}, at: ldsem_down_read+0x3c/0x4c drivers/tty/tty_ldsem.c:340
#1: ffff0000d0e5c130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:944 [inline]
#1: ffff0000d0e5c130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:967 [inline]
#1: ffff0000d0e5c130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write+0x18c/0x6f0 drivers/tty/tty_io.c:1089
#2: ffff0000d9d843e0 (&gsm->tx_lock){....}-{2:2}, at: gsmld_write+0x60/0x154 drivers/tty/n_gsm.c:3056
irq event stamp: 304
hardirqs last enabled at (303): [<ffff800008062eb4>] local_daif_restore arch/arm64/include/asm/daifflags.h:75 [inline]
hardirqs last enabled at (303): [<ffff800008062eb4>] el0_svc_common+0x9c/0x258 arch/arm64/kernel/syscall.c:107
hardirqs last disabled at (304): [<ffff800012338e58>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline]
hardirqs last disabled at (304): [<ffff800012338e58>] _raw_spin_lock_irqsave+0xa4/0xb4 kernel/locking/spinlock.c:162
softirqs last enabled at (298): [<ffff8000080337c4>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (296): [<ffff800008033790>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
Preemption disabled at:
[<ffff80000b6b0348>] gsmld_write+0x60/0x154 drivers/tty/n_gsm.c:3056
CPU: 0 PID: 10302 Comm: syz-executor.4 Not tainted 6.1.20-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x5c lib/dump_stack.c:113
__might_resched+0x37c/0x4d8 kernel/sched/core.c:9938
__might_sleep+0x90/0xe4 kernel/sched/core.c:9867
console_lock+0x28/0xb8 kernel/printk/printk.c:2565
do_con_write+0x14c/0x5b14 drivers/tty/vt/vt.c:2908
con_write+0x34/0x58 drivers/tty/vt/vt.c:3295
gsmld_write+0x104/0x154 drivers/tty/n_gsm.c:3059
do_tty_write drivers/tty/tty_io.c:1018 [inline]
file_tty_write+0x404/0x6f0 drivers/tty/tty_io.c:1089
tty_write+0x48/0x58 drivers/tty/tty_io.c:1110
call_write_iter include/linux/fs.h:2205 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x610/0x914 fs/read_write.c:584
ksys_write+0x15c/0x26c fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__arm64_sys_write+0x7c/0x90 fs/read_write.c:646
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Mar 20, 2023, 6:42:43 AM3/20/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 7eaef76fbc46 Linux 6.1.20
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13e93091c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=29ad3fe3c7b61175
dashboard link: https://syzkaller.appspot.com/bug?extid=3b4e5a312b4a72ffb261
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13e50711c80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13d1f8f2c80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/34f95428f5fb/disk-7eaef76f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1bdd9b2c390d/vmlinux-7eaef76f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/419140981cfa/Image-7eaef76f.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3b4e5a...@syzkaller.appspotmail.com

BUG: sleeping function called from invalid context at kernel/printk/printk.c:2565
in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 4319, name: syz-executor600
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
3 locks held by syz-executor600/4319:
#0: ffff0000d62cc098 (&tty->ldisc_sem){++++}-{0:0}, at: ldsem_down_read+0x3c/0x4c drivers/tty/tty_ldsem.c:340
#1: ffff0000d62cc130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:944 [inline]
#1: ffff0000d62cc130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:967 [inline]
#1: ffff0000d62cc130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write+0x18c/0x6f0 drivers/tty/tty_io.c:1089
#2: ffff0000c0c133e0 (&gsm->tx_lock){....}-{2:2}, at: gsmld_write+0x60/0x154 drivers/tty/n_gsm.c:3056
irq event stamp: 504
hardirqs last enabled at (503): [<ffff8000122584e8>] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:84 [inline]
hardirqs last enabled at (503): [<ffff8000122584e8>] exit_to_kernel_mode+0xe8/0x118 arch/arm64/kernel/entry-common.c:94
hardirqs last disabled at (504): [<ffff800012338e58>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline]
hardirqs last disabled at (504): [<ffff800012338e58>] _raw_spin_lock_irqsave+0xa4/0xb4 kernel/locking/spinlock.c:162
softirqs last enabled at (392): [<ffff8000080337c4>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (390): [<ffff800008033790>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
Preemption disabled at:
[<ffff80000b6b0348>] gsmld_write+0x60/0x154 drivers/tty/n_gsm.c:3056
CPU: 1 PID: 4319 Comm: syz-executor600 Not tainted 6.1.20-syzkaller #0
Reply all
Reply to author
Forward
0 new messages