syzbot


INFO: task hung in kernfs_remove (2)

Status: auto-obsoleted due to no activity on 2024/12/31 03:21
Subsystems: kernfs
[Documentation on labels]
First crash: 121d, last: 110d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 INFO: task hung in kernfs_remove 1 1892d 1892d 0/1 auto-closed as invalid on 2020/03/15 06:19
android-414 INFO: task hung in kernfs_remove 1 2149d 2108d 0/1 auto-closed as invalid on 2019/08/31 16:46
upstream INFO: task hung in kernfs_remove kernfs 2 234d 235d 0/28 auto-obsoleted due to no activity on 2024/08/29 15:31

Sample crash report:
INFO: task kworker/1:2:4912 blocked for more than 143 seconds.
      Not tainted 6.12.0-rc1-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/1:2     state:D
 stack:20624 pid:4912  tgid:4912  ppid:2      flags:0x00004000
Workqueue: usb_hub_wq hub_event

Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5315 [inline]
 __schedule+0x105f/0x34b0 kernel/sched/core.c:6675
 __schedule_loop kernel/sched/core.c:6752 [inline]
 schedule+0xe7/0x350 kernel/sched/core.c:6767
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6824
 rwsem_down_write_slowpath+0x539/0x12a0 kernel/locking/rwsem.c:1176
 __down_write_common kernel/locking/rwsem.c:1304 [inline]
 __down_write kernel/locking/rwsem.c:1313 [inline]
 down_write+0x1d8/0x200 kernel/locking/rwsem.c:1578
 kernfs_remove+0x71/0xa0 fs/kernfs/dir.c:1527
 sysfs_remove_dir+0xc8/0x100 fs/sysfs/dir.c:101
 __kobject_del+0xe2/0x1f0 lib/kobject.c:604
 kobject_del lib/kobject.c:627 [inline]
 kobject_del+0x3f/0x60 lib/kobject.c:619
 device_del+0x64e/0x9f0 drivers/base/core.c:3884
 usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418
 usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2304
 hub_port_connect drivers/usb/core/hub.c:5361 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
 port_event drivers/usb/core/hub.c:5821 [inline]
 hub_event+0x1bed/0x4f40 drivers/usb/core/hub.c:5903
 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229
 process_scheduled_works kernel/workqueue.c:3310 [inline]
 worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391
 kthread+0x2c1/0x3a0 kernel/kthread.c:389
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
INFO: task syz.3.3766:21073 blocked for more than 143 seconds.
      Not tainted 6.12.0-rc1-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.3.3766      state:D
 stack:28976 pid:21073 tgid:21072 ppid:17254  flags:0x00000004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5315 [inline]
 __schedule+0x105f/0x34b0 kernel/sched/core.c:6675
 __schedule_loop kernel/sched/core.c:6752 [inline]
 schedule+0xe7/0x350 kernel/sched/core.c:6767
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6824
 rwsem_down_write_slowpath+0x539/0x12a0 kernel/locking/rwsem.c:1176
 __down_write_common kernel/locking/rwsem.c:1304 [inline]
 __down_write kernel/locking/rwsem.c:1313 [inline]
 down_write+0x1d8/0x200 kernel/locking/rwsem.c:1578
 kernfs_add_one+0xb1/0x520 fs/kernfs/dir.c:778
 kernfs_create_dir_ns+0xf4/0x150 fs/kernfs/dir.c:1071
 sysfs_create_dir_ns+0x13b/0x2b0 fs/sysfs/dir.c:59
 create_dir lib/kobject.c:73 [inline]
 kobject_add_internal+0x2c8/0x990 lib/kobject.c:240
 kobject_add_varg lib/kobject.c:374 [inline]
 kobject_init_and_add+0x11c/0x190 lib/kobject.c:457
 bus_add_driver+0x186/0x690 drivers/base/bus.c:668
 driver_register+0x15c/0x4b0 drivers/base/driver.c:246
 usb_gadget_register_driver_owner+0xfd/0x2f0 drivers/usb/gadget/udc/core.c:1699
 raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:595 [inline]
 raw_ioctl+0x1731/0x2b90 drivers/usb/gadget/legacy/raw_gadget.c:1306
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl fs/ioctl.c:893 [inline]
 __x64_sys_ioctl+0x18f/0x220 fs/ioctl.c:893
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f52865adbfb
RSP: 002b:00007f528521ef10 EFLAGS: 00000246
 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f52865adbfb
RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000004
RBP: 00007f528521ffe0 R08: 0000000000000000 R09: 00332e6364755f79
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f528521efb0 R14: 0000000020000140 R15: 00007f5286890320
 </TASK>
INFO: task syz.2.3767:21075 blocked for more than 144 seconds.
      Not tainted 6.12.0-rc1-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.2.3767      state:D
 stack:28992 pid:21075 tgid:21074 ppid:11140  flags:0x00000004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5315 [inline]
 __schedule+0x105f/0x34b0 kernel/sched/core.c:6675
 __schedule_loop kernel/sched/core.c:6752 [inline]
 schedule+0xe7/0x350 kernel/sched/core.c:6767
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6824
 rwsem_down_write_slowpath+0x539/0x12a0 kernel/locking/rwsem.c:1176
 __down_write_common kernel/locking/rwsem.c:1304 [inline]
 __down_write kernel/locking/rwsem.c:1313 [inline]
 down_write+0x1d8/0x200 kernel/locking/rwsem.c:1578
 kernfs_add_one+0xb1/0x520 fs/kernfs/dir.c:778
 kernfs_create_dir_ns+0xf4/0x150 fs/kernfs/dir.c:1071
 sysfs_create_dir_ns+0x13b/0x2b0 fs/sysfs/dir.c:59
 create_dir lib/kobject.c:73 [inline]
 kobject_add_internal+0x2c8/0x990 lib/kobject.c:240
 kobject_add_varg lib/kobject.c:374 [inline]
 kobject_init_and_add+0x11c/0x190 lib/kobject.c:457
 bus_add_driver+0x186/0x690 drivers/base/bus.c:668
 driver_register+0x15c/0x4b0 drivers/base/driver.c:246
 usb_gadget_register_driver_owner+0xfd/0x2f0 drivers/usb/gadget/udc/core.c:1699
 raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:595 [inline]
 raw_ioctl+0x1731/0x2b90 drivers/usb/gadget/legacy/raw_gadget.c:1306
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl fs/ioctl.c:893 [inline]
 __x64_sys_ioctl+0x18f/0x220 fs/ioctl.c:893
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f884428dbfb
RSP: 002b:00007f8842f04f10 EFLAGS: 00000246
 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f884428dbfb
RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000003
RBP: 00007f8842f05fe0 R08: 0000000000000000 R09: 00322e6364755f79
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f8842f04fb0 R14: 0000000020000000 R15: 00007f8844570320
 </TASK>

Showing all locks held in the system:
8 locks held by kworker/0:0/8:
4 locks held by kworker/1:0/24:
1 lock held by khungtaskd/30:
 #0: 
ffffffff88ebb100
 (
rcu_read_lock
){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
){....}-{1:2}, at: debug_show_all_locks+0x7f/0x390 kernel/locking/lockdep.c:6720
3 locks held by kworker/u8:9/1980:
 #0: 
ffff888100abb148 (
(wq_completion)netns){+.+.}-{0:0}
, at: process_one_work+0x129b/0x1ba0 kernel/workqueue.c:3204
 #1: 
ffffc9000430fd80 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x921/0x1ba0 kernel/workqueue.c:3205
 #2: ffffffff8a18c2d0 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0xbb/0xb40 net/core/net_namespace.c:580
2 locks held by getty/2607:
 #0: 
ffff88810aaf60a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x24/0x80 drivers/tty/tty_ldisc.c:243
 #1: 
ffffc900000432f0
 (
&ldata->atomic_read_lock
){+.+.}-{3:3}
, at: n_tty_read+0xfba/0x1480 drivers/tty/n_tty.c:2211
4 locks held by kworker/1:2/4912:
1 lock held by udevd/6159:
 #0: 
ffff888100abc148
 (
&root->kernfs_rwsem
){++++}-{3:3}
, at: kernfs_dop_revalidate+0xf0/0x5a0 fs/kernfs/dir.c:1159
1 lock held by udevd/6161:
 #0: ffff888100abc148
 (
&root->kernfs_rwsem){++++}-{3:3}
, at: kernfs_dop_revalidate+0xf0/0x5a0 fs/kernfs/dir.c:1159
1 lock held by udevd/6173:
 #0: ffff888100abc148
 (&root->kernfs_rwsem
){++++}-{3:3}, at: kernfs_dop_revalidate+0xf0/0x5a0 fs/kernfs/dir.c:1159
4 locks held by kworker/0:6/10847:
1 lock held by syz-executor/11141:
 #0: ffff888100abc148
 (&root->kernfs_rwsem
){++++}-{3:3}
, at: kernfs_dop_revalidate+0x39e/0x5a0 fs/kernfs/dir.c:1141
1 lock held by syz-executor/11143:
 #0: 
ffff888100abc148 (
&root->kernfs_rwsem){++++}-{3:3}
, at: kernfs_dop_revalidate+0x39e/0x5a0 fs/kernfs/dir.c:1141
2 locks held by kworker/1:7/15239:
 #0: 
ffff888100080948 (
(wq_completion)events){+.+.}-{0:0}
, at: process_one_work+0x129b/0x1ba0 kernel/workqueue.c:3204
 #1: 
ffffc9000b427d80 (
free_ipc_work){+.+.}-{0:0}
, at: process_one_work+0x921/0x1ba0 kernel/workqueue.c:3205
4 locks held by kworker/1:8/17016:
1 lock held by syz-executor/17254:
 #0: ffff888100abc148 (&root->kernfs_rwsem
){++++}-{3:3}, at: kernfs_dop_revalidate+0x39e/0x5a0 fs/kernfs/dir.c:1141
1 lock held by syz-executor/17860:
 #0: 
ffff888100abc148 (&root->kernfs_rwsem){++++}-{3:3}
, at: kernfs_dop_revalidate+0x39e/0x5a0 fs/kernfs/dir.c:1141
1 lock held by syz.0.3759/21064:
 #0: ffffffff88ec6a78
 (rcu_state.exp_mutex
){+.+.}-{3:3}, at: exp_funnel_lock+0x1a4/0x3b0 kernel/rcu/tree_exp.h:329
1 lock held by syz.1.3765/21069:
 #0: 
ffff888100abc148
 (&root->kernfs_rwsem
){++++}-{3:3}
, at: kernfs_activate fs/kernfs/dir.c:1403 [inline]
, at: kernfs_add_one+0x39d/0x520 fs/kernfs/dir.c:819
1 lock held by syz-executor/21076:
 #0: ffff888100abc148
 (&root->kernfs_rwsem
){++++}-{3:3}
, at: kernfs_dop_revalidate+0xf0/0x5a0 fs/kernfs/dir.c:1159
1 lock held by syz-executor/21077:
 #0: 
ffff888100abc148
 (&root->kernfs_rwsem){++++}-{3:3}, at: kernfs_dop_revalidate+0xf0/0x5a0 fs/kernfs/dir.c:1159
1 lock held by syz-executor/21078:
 #0: ffff888100abc148 (&root->kernfs_rwsem
){++++}-{3:3}
, at: kernfs_dop_revalidate+0xf0/0x5a0 fs/kernfs/dir.c:1159
1 lock held by syz-executor/21079:
 #0: ffff888100abc148 (&root->kernfs_rwsem
){++++}-{3:3}, at: kernfs_dop_revalidate+0xf0/0x5a0 fs/kernfs/dir.c:1159
1 lock held by syz-executor/21080:
 #0: 
ffff888100abc148
 (
&root->kernfs_rwsem){++++}-{3:3}
, at: kernfs_dop_revalidate+0xf0/0x5a0 fs/kernfs/dir.c:1159

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

NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 30 Comm: khungtaskd Not tainted 6.12.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 nmi_cpu_backtrace+0x27b/0x390 lib/nmi_backtrace.c:113
 nmi_trigger_cpumask_backtrace+0x29c/0x300 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+0xf0c/0x1240 kernel/hung_task.c:379
 kthread+0x2c1/0x3a0 kernel/kthread.c:389
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
Sending NMI from CPU 1 to CPUs 0:
imon 1-1:0.0: imon usb_rx_callback_intf0: status(-71): ignored
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.12.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events_power_efficient gc_worker
RIP: 0010:io_serial_out+0x8f/0xb0 drivers/tty/serial/8250/8250_port.c:413
Code: 48 8d 7d 40 44 89 e1 48 b8 00 00 00 00 00 fc ff df 48 89 fa d3 e3 48 c1 ea 03 80 3c 02 00 75 1c 66 03 5d 40 44 89 e8 89 da ee <5b> 5d 41 5c 41 5d c3 cc cc cc cc e8 f1 eb 0d ff eb a0 e8 7a ec 0d
RSP: 0018:ffffc90000007510 EFLAGS: 00000002
RAX: 0000000000000031 RBX: 00000000000003f8 RCX: 0000000000000000
RDX: 00000000000003f8 RSI: ffffffff82a076c5 RDI: ffffffff936356a0
RBP: ffffffff93635660 R08: 0000000000000001 R09: 000000000000001f
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000031 R14: ffffffff82a07660 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8881f5800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c3615db CR3: 000000011f16c000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <IRQ>
 serial_out drivers/tty/serial/8250/8250.h:142 [inline]
 serial8250_console_fifo_write drivers/tty/serial/8250/8250_port.c:3322 [inline]
 serial8250_console_write+0xf9e/0x17c0 drivers/tty/serial/8250/8250_port.c:3393
 console_emit_next_record kernel/printk/printk.c:3092 [inline]
 console_flush_all+0x800/0xc60 kernel/printk/printk.c:3180
 __console_flush_and_unlock kernel/printk/printk.c:3239 [inline]
 console_unlock+0xd9/0x210 kernel/printk/printk.c:3279
 vprintk_emit+0x424/0x6f0 kernel/printk/printk.c:2407
 dev_vprintk_emit drivers/base/core.c:4910 [inline]
 dev_printk_emit+0xfb/0x140 drivers/base/core.c:4921
 __dev_printk+0xf5/0x270 drivers/base/core.c:4933
 _dev_warn+0xe5/0x120 drivers/base/core.c:4977
 usb_rx_callback_intf0+0x11c/0x1a0 drivers/media/rc/imon.c:1768
 __usb_hcd_giveback_urb+0x389/0x6e0 drivers/usb/core/hcd.c:1650
 usb_hcd_giveback_urb+0x396/0x450 drivers/usb/core/hcd.c:1734
 dummy_timer+0x17c3/0x38d0 drivers/usb/gadget/udc/dummy_hcd.c:1988
 __run_hrtimer kernel/time/hrtimer.c:1691 [inline]
 __hrtimer_run_queues+0x20a/0xae0 kernel/time/hrtimer.c:1755
 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1772
 handle_softirqs+0x206/0x8d0 kernel/softirq.c:554
 __do_softirq kernel/softirq.c:588 [inline]
 invoke_softirq kernel/softirq.c:428 [inline]
 __irq_exit_rcu kernel/softirq.c:637 [inline]
 irq_exit_rcu+0xac/0x110 kernel/softirq.c:649
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline]
 sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1037
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:native_irq_disable arch/x86/include/asm/irqflags.h:37 [inline]
RIP: 0010:arch_local_irq_disable arch/x86/include/asm/irqflags.h:92 [inline]
RIP: 0010:arch_local_irq_save arch/x86/include/asm/irqflags.h:124 [inline]
RIP: 0010:lock_acquire.part.0+0xd3/0x380 kernel/locking/lockdep.c:5821
Code: 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 80 02 00 00 8b 95 94 0a 00 00 85 d2 0f 85 d5 00 00 00 44 89 44 24 04 89 0c 24 9c 5d <fa> 48 c7 c7 60 f4 27 87 e8 70 2c bb 05 44 89 e2 44 89 f6 4c 89 ef
RSP: 0018:ffffc9000008fae0 EFLAGS: 00000246
RAX: 0000000000000007 RBX: 1ffff92000011f5d RCX: 0000000000000002
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff888101696254
RBP: 0000000000000246 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff8a56400f R11: 0000000000000000 R12: 0000000000000000
R13: ffffffff88ebb100 R14: 0000000000000000 R15: 0000000000000000
 rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 rcu_read_lock include/linux/rcupdate.h:849 [inline]
 gc_worker+0x24d/0x1760 net/netfilter/nf_conntrack_core.c:1532
 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229
 process_scheduled_works kernel/workqueue.c:3310 [inline]
 worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391
 kthread+0x2c1/0x3a0 kernel/kthread.c:389
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/02 03:18 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9852d85ec9d4 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb INFO: task hung in kernfs_remove
2024/09/21 08:36 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 68d4209158f4 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb INFO: task hung in kernfs_remove
* Struck through repros no longer work on HEAD.