BUG: INFO: task hung in tty_ldisc_hangup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
We found the following issue using syzkaller on Linux v6.10.
In `ttty_ldisc_hangup` the task hung when trying to execute the
`tty_ldisc_lock` function.

Unfortunately, the syzkaller failed to generate a reproducer.
But at least we have the report:

INFO: task syz.1.1480:25893 blocked for more than 143 seconds.
      Not tainted 6.10.0 #13
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.1.1480      state:D stack:25768 pid:25893 tgid:25892
ppid:22615  flags:0x00000004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5407 [inline]
 __schedule+0xf4a/0x15e0 kernel/sched/core.c:6748
 __schedule_loop kernel/sched/core.c:6825 [inline]
 schedule+0x143/0x310 kernel/sched/core.c:6840
 schedule_timeout+0xac/0x300 kernel/time/timer.c:2557
 down_write_failed drivers/tty/tty_ldsem.c:262 [inline]
 __ldsem_down_write_nested+0x3cb/0x910 drivers/tty/tty_ldsem.c:324
 __tty_ldisc_lock drivers/tty/tty_ldisc.c:289 [inline]
 tty_ldisc_lock+0x6a/0xb0 drivers/tty/tty_ldisc.c:313
 tty_ldisc_hangup+0x23c/0x4c0 drivers/tty/tty_ldisc.c:718
 __tty_hangup+0x407/0x6c0 drivers/tty/tty_io.c:630
 tty_vhangup drivers/tty/tty_io.c:700 [inline]
 tty_ioctl+0x726/0xdb0 drivers/tty/tty_io.c:2743
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl+0xfe/0x170 fs/ioctl.c:893
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x7e/0x150 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x67/0x6f
RIP: 0033:0x7fbbaa1809b9
RSP: 002b:00007fbbaaedc038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fbbaa345f80 RCX: 00007fbbaa1809b9
RDX: 0000000000000000 RSI: 0000000000005437 RDI: 0000000000000004
RBP: 00007fbbaa1f4f70 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fbbaa345f80 R15: 00007ffd9f1583d8
 </TASK>
INFO: task syz.1.1480:25961 blocked for more than 143 seconds.
      Not tainted 6.10.0 #13
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.1.1480      state:D stack:27224 pid:25961 tgid:25892
ppid:22615  flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5407 [inline]
 __schedule+0xf4a/0x15e0 kernel/sched/core.c:6748
 __schedule_loop kernel/sched/core.c:6825 [inline]
 schedule+0x143/0x310 kernel/sched/core.c:6840
 gsm_cleanup_mux+0x344/0x930 drivers/tty/n_gsm.c:3136
 gsm_config drivers/tty/n_gsm.c:3408 [inline]
 gsmld_ioctl+0x13c4/0x2540 drivers/tty/n_gsm.c:3839
 tty_ioctl+0x98f/0xdb0 drivers/tty/tty_io.c:2812
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl+0xfe/0x170 fs/ioctl.c:893
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x7e/0x150 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x67/0x6f
RIP: 0033:0x7fbbaa1809b9
RSP: 002b:00007fbba9bff038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fbbaa346130 RCX: 00007fbbaa1809b9
RDX: 0000000020000100 RSI: 00000000404c4701 RDI: 0000000000000004
RBP: 00007fbbaa1f4f70 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007fbbaa346130 R15: 00007ffd9f1583d8
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/25:
 #0: ffffffff8db32fe0 (rcu_read_lock){....}-{1:2}, at:
rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #0: ffffffff8db32fe0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock
include/linux/rcupdate.h:781 [inline]
 #0: ffffffff8db32fe0 (rcu_read_lock){....}-{1:2}, at:
debug_show_all_locks+0x54/0x2d0 kernel/locking/lockdep.c:6614
1 lock held by in:imklog/7649:
2 locks held by syz-executor/8034:
2 locks held by agetty/13559:
 #0: ffff88803d8e50a0 (&tty->ldisc_sem){++++}-{0:0}, at:
tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffffc900041d32f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at:
n_tty_read+0x712/0x1e80 drivers/tty/n_tty.c:2211
2 locks held by systemd-udevd/18316:
2 locks held by systemd-udevd/18325:
 #0: ffff88801ed3e420 (sb_writers#7){.+.+}-{0:0}, at:
mnt_want_write+0x3b/0x80 fs/namespace.c:409
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
inode_lock include/linux/fs.h:791 [inline]
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
open_last_lookups fs/namei.c:3571 [inline]
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
path_openat+0x7d8/0x3580 fs/namei.c:3810
2 locks held by systemd-udevd/18326:
 #0: ffff88801ed3e420 (sb_writers#7){.+.+}-{0:0}, at:
mnt_want_write+0x3b/0x80 fs/namespace.c:409
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
inode_lock include/linux/fs.h:791 [inline]
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
open_last_lookups fs/namei.c:3571 [inline]
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
path_openat+0x7d8/0x3580 fs/namei.c:3810
2 locks held by systemd-udevd/18382:
2 locks held by systemd-udevd/18500:
 #0: ffff88801ed3e420 (sb_writers#7){.+.+}-{0:0}, at:
mnt_want_write+0x3b/0x80 fs/namespace.c:409
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
inode_lock include/linux/fs.h:791 [inline]
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
open_last_lookups fs/namei.c:3571 [inline]
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
path_openat+0x7d8/0x3580 fs/namei.c:3810
1 lock held by systemd-udevd/18504:
2 locks held by systemd-udevd/18505:
 #0: ffff88801ed3e420 (sb_writers#7){.+.+}-{0:0}, at:
mnt_want_write+0x3b/0x80 fs/namespace.c:409
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
inode_lock include/linux/fs.h:791 [inline]
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
open_last_lookups fs/namei.c:3571 [inline]
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
path_openat+0x7d8/0x3580 fs/namei.c:3810
1 lock held by systemd-udevd/18822:
1 lock held by systemd-udevd/18860:
1 lock held by systemd-udevd/18902:
1 lock held by systemd-udevd/18908:
1 lock held by systemd-udevd/18925:
1 lock held by systemd-udevd/19029:
 #0: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
inode_lock_shared include/linux/fs.h:801 [inline]
 #0: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
open_last_lookups fs/namei.c:3573 [inline]
 #0: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
path_openat+0x7c9/0x3580 fs/namei.c:3810
2 locks held by systemd-udevd/19104:
 #0: ffff88801ed3e420 (sb_writers#7){.+.+}-{0:0}, at:
mnt_want_write+0x3b/0x80 fs/namespace.c:409
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
inode_lock include/linux/fs.h:791 [inline]
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
open_last_lookups fs/namei.c:3571 [inline]
 #1: ffff888025385d48 (&type->i_mutex_dir_key#5){++++}-{3:3}, at:
path_openat+0x7d8/0x3580 fs/namei.c:3810
2 locks held by agetty/20613:
 #0: ffff888042a120a0 (&tty->ldisc_sem){++++}-{0:0}, at:
tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffffc90002de82f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at:
n_tty_read+0x712/0x1e80 drivers/tty/n_tty.c:2211
2 locks held by agetty/22206:
 #0: ffff8880451e10a0 (&tty->ldisc_sem){++++}-{0:0}, at:
tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffffc900018482f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at:
n_tty_read+0x712/0x1e80 drivers/tty/n_tty.c:2211
2 locks held by syz.1.1480/25893:
 #0: ffff88803ff751c0 (&tty->legacy_mutex){+.+.}-{3:3}, at:
__tty_hangup+0xcc/0x6c0 drivers/tty/tty_io.c:590
 #1: ffff88803ff750a0 (&tty->ldisc_sem){++++}-{0:0}, at:
__tty_ldisc_lock drivers/tty/tty_ldisc.c:289 [inline]
 #1: ffff88803ff750a0 (&tty->ldisc_sem){++++}-{0:0}, at:
tty_ldisc_lock+0x6a/0xb0 drivers/tty/tty_ldisc.c:313
2 locks held by syz.1.1480/25961:
 #0: ffff88803ff750a0 (&tty->ldisc_sem){++++}-{0:0}, at:
tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffff88804484f0b0 (&gsm->mutex){+.+.}-{3:3}, at:
gsm_cleanup_mux+0xb7/0x930 drivers/tty/n_gsm.c:3130
1 lock held by syz.1.1868/30326:
1 lock held by systemd-sysctl/30475:
2 locks held by systemd-sysctl/30480:
2 locks held by syz.0.1895/30484:
 #0: ffffffff8e8387a8 (input_mutex){+.+.}-{3:3}, at:
__input_unregister_device+0x2ff/0x630 drivers/input/input.c:2293
 #1: ffffffff8db383f8 (rcu_state.exp_mutex){+.+.}-{3:3}, at:
exp_funnel_lock kernel/rcu/tree_exp.h:291 [inline]
 #1: ffffffff8db383f8 (rcu_state.exp_mutex){+.+.}-{3:3}, at:
synchronize_rcu_expedited+0x37c/0x810 kernel/rcu/tree_exp.h:939
3 locks held by syz.0.1895/30488:
2 locks held by apt-config/30483:

=============================================

NMI backtrace for cpu 0
CPU: 0 PID: 25 Comm: khungtaskd Not tainted 6.10.0 #13
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x23d/0x360 lib/dump_stack.c:114
 nmi_cpu_backtrace+0x451/0x480 lib/nmi_backtrace.c:113
 nmi_trigger_cpumask_backtrace+0x181/0x2d0 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:162 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:223 [inline]
 watchdog+0xdbd/0xe00 kernel/hung_task.c:379
 kthread+0x2eb/0x380 kernel/kthread.c:389
 ret_from_fork+0x49/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:244
 </TASK>




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux