syzbot


INFO: task hung in kernfs_add_one

Status: upstream: reported C repro on 2024/05/28 06:00
Subsystems: kernfs usb
[Documentation on labels]
Reported-by: syzbot+e4804edf2708e8b7d2a5@syzkaller.appspotmail.com
First crash: 27d, last: 1d17h
Cause bisection: failed (error log, bisect log)
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernfs?] [usb?] INFO: task hung in kernfs_add_one 0 (1) 2024/05/28 06:00

Sample crash report:
INFO: task kworker/0:1:9 blocked for more than 141 seconds.
      Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:1     state:D
 stack:22320 pid:9     tgid:9     ppid:2      flags:0x00004000
Workqueue: usb_hub_wq hub_event

Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5408 [inline]
 __schedule+0x17e8/0x4a20 kernel/sched/core.c:6745
 __schedule_loop kernel/sched/core.c:6822 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6837
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894
 rwsem_down_write_slowpath+0xeeb/0x13b0 kernel/locking/rwsem.c:1178
 __down_write_common+0x1af/0x200 kernel/locking/rwsem.c:1306
 kernfs_add_one+0x9a/0x8b0 fs/kernfs/dir.c:778
 kernfs_create_dir_ns+0xd9/0x120 fs/kernfs/dir.c:1071
 sysfs_create_dir_ns+0x189/0x3a0 fs/sysfs/dir.c:59
 create_dir lib/kobject.c:73 [inline]
 kobject_add_internal+0x435/0x8d0 lib/kobject.c:240
 kobject_add_varg lib/kobject.c:374 [inline]
 kobject_add+0x152/0x220 lib/kobject.c:426
 device_add+0x4e5/0xbf0 drivers/base/core.c:3659
 usb_new_device+0x104a/0x19a0 drivers/usb/core/hub.c:2651
 hub_port_connect drivers/usb/core/hub.c:5521 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
 port_event drivers/usb/core/hub.c:5821 [inline]
 hub_event+0x2d6a/0x5150 drivers/usb/core/hub.c:5903
 process_one_work kernel/workqueue.c:3231 [inline]
 process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
INFO: task jbd2/sda1-8:4506 blocked for more than 142 seconds.
      Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:jbd2/sda1-8     state:D
 stack:24824 pid:4506  tgid:4506  ppid:2      flags:0x00004000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5408 [inline]
 __schedule+0x17e8/0x4a20 kernel/sched/core.c:6745
 __schedule_loop kernel/sched/core.c:6822 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6837
 io_schedule+0x8d/0x110 kernel/sched/core.c:9043
 bit_wait_io+0x12/0xd0 kernel/sched/wait_bit.c:209
 __wait_on_bit+0xb0/0x2f0 kernel/sched/wait_bit.c:49
 out_of_line_wait_on_bit+0x1d5/0x260 kernel/sched/wait_bit.c:64
 wait_on_buffer include/linux/buffer_head.h:415 [inline]
 journal_wait_on_commit_record fs/jbd2/commit.c:171 [inline]
 jbd2_journal_commit_transaction+0x3d7f/0x6760 fs/jbd2/commit.c:887
 kjournald2+0x463/0x850 fs/jbd2/journal.c:201
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
INFO: task udevd:4543 blocked for more than 143 seconds.
      Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:udevd           state:D
 stack:23376 pid:4543  tgid:4543  ppid:1      flags:0x00004002
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5408 [inline]
 __schedule+0x17e8/0x4a20 kernel/sched/core.c:6745
 __schedule_loop kernel/sched/core.c:6822 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6837
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894
 rwsem_down_read_slowpath kernel/locking/rwsem.c:1086 [inline]
 __down_read_common kernel/locking/rwsem.c:1250 [inline]
 __down_read kernel/locking/rwsem.c:1263 [inline]
 down_read+0x705/0xa40 kernel/locking/rwsem.c:1528
 kernfs_dop_revalidate+0xd4/0x560 fs/kernfs/dir.c:1159
 lookup_fast+0x1f4/0x4a0
 walk_component fs/namei.c:2000 [inline]
 link_path_walk+0x60b/0xea0 fs/namei.c:2331
 path_openat+0x24a/0x3280 fs/namei.c:3803
 do_filp_open+0x235/0x490 fs/namei.c:3834
 do_sys_openat2+0x13e/0x1d0 fs/open.c:1405
 do_sys_open fs/open.c:1420 [inline]
 __do_sys_openat fs/open.c:1436 [inline]
 __se_sys_openat fs/open.c:1431 [inline]
 __x64_sys_openat+0x247/0x2a0 fs/open.c:1431
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f46cb1169a4
RSP: 002b:00007ffec0ae8520 EFLAGS: 00000246
 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00007f46cb1169a4
RDX: 0000000000080000 RSI: 00007ffec0ae8658 RDI: 00000000ffffff9c
RBP: 00007ffec0ae8658 R08: 0000000000000008 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080000
R13: 000055f970a24b42 R14: 0000000000000001 R15: 0000000000000000
 </TASK>
INFO: task kworker/0:5:5219 blocked for more than 145 seconds.
      Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:5     state:D
 stack:21968 pid:5219  tgid:5219  ppid:2      flags:0x00004000
Workqueue: usb_hub_wq hub_event

Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5408 [inline]
 __schedule+0x17e8/0x4a20 kernel/sched/core.c:6745
 __schedule_loop kernel/sched/core.c:6822 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6837
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894
 rwsem_down_write_slowpath+0xeeb/0x13b0 kernel/locking/rwsem.c:1178
 __down_write_common+0x1af/0x200 kernel/locking/rwsem.c:1306
 kernfs_add_one+0x9a/0x8b0 fs/kernfs/dir.c:778
 __kernfs_create_file+0x22e/0x2e0 fs/kernfs/file.c:1063
 sysfs_add_file_mode_ns+0x24a/0x310 fs/sysfs/file.c:307
 sysfs_create_file_ns+0x197/0x2a0 fs/sysfs/file.c:368
 device_add+0x522/0xbf0 drivers/base/core.c:3668
 usb_create_ep_devs+0x130/0x230 drivers/usb/core/endpoint.c:169
 create_intf_ep_devs drivers/usb/core/message.c:1252 [inline]
 usb_set_configuration+0x1a9d/0x1fb0 drivers/usb/core/message.c:2216
 usb_generic_driver_probe+0x88/0x140 drivers/usb/core/generic.c:254
 usb_probe_device+0x1b8/0x380 drivers/usb/core/driver.c:294
 really_probe+0x2b8/0xad0 drivers/base/dd.c:656
 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:798
 driver_probe_device+0x50/0x430 drivers/base/dd.c:828
 __device_attach_driver+0x2d6/0x530 drivers/base/dd.c:956
 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:457
 __device_attach+0x333/0x520 drivers/base/dd.c:1028
 bus_probe_device+0x189/0x260 drivers/base/bus.c:532
 device_add+0x856/0xbf0 drivers/base/core.c:3721
 usb_new_device+0x104a/0x19a0 drivers/usb/core/hub.c:2651
 hub_port_connect drivers/usb/core/hub.c:5521 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
 port_event drivers/usb/core/hub.c:5821 [inline]
 hub_event+0x2d6a/0x5150 drivers/usb/core/hub.c:5903
 process_one_work kernel/workqueue.c:3231 [inline]
 process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
INFO: task udevd:5376 blocked for more than 146 seconds.
      Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:udevd           state:D
 stack:25584 pid:5376  tgid:5376  ppid:4543   flags:0x00004002
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5408 [inline]
 __schedule+0x17e8/0x4a20 kernel/sched/core.c:6745
 __schedule_loop kernel/sched/core.c:6822 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6837
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894
 rwsem_down_read_slowpath kernel/locking/rwsem.c:1086 [inline]
 __down_read_common kernel/locking/rwsem.c:1250 [inline]
 __down_read kernel/locking/rwsem.c:1263 [inline]
 down_read+0x705/0xa40 kernel/locking/rwsem.c:1528
 kernfs_dop_revalidate+0xd4/0x560 fs/kernfs/dir.c:1159
 lookup_fast+0x1f4/0x4a0
 walk_component fs/namei.c:2000 [inline]
 link_path_walk+0x60b/0xea0 fs/namei.c:2331
 path_openat+0x24a/0x3280 fs/namei.c:3803
 do_filp_open+0x235/0x490 fs/namei.c:3834
 do_sys_openat2+0x13e/0x1d0 fs/open.c:1405
 do_sys_open fs/open.c:1420 [inline]
 __do_sys_openat fs/open.c:1436 [inline]
 __se_sys_openat fs/open.c:1431 [inline]
 __x64_sys_openat+0x247/0x2a0 fs/open.c:1431
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f46cb1169a4
RSP: 002b:00007ffec0ae8370 EFLAGS: 00000246
 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00007f46cb1169a4
RDX: 0000000000080000 RSI: 00007ffec0ae84a8 RDI: 00000000ffffff9c
RBP: 00007ffec0ae84a8 R08: 0000000000000008 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080000
R13: 000055f970a24b42 R14: 0000000000000001 R15: 000055f99aed3910
 </TASK>
INFO: task syz-executor384:5377 blocked for more than 147 seconds.
      Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor384 state:D stack:26624 pid:5377  tgid:5377  ppid:5132   flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5408 [inline]
 __schedule+0x17e8/0x4a20 kernel/sched/core.c:6745
 __schedule_loop kernel/sched/core.c:6822 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6837
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894
 rwsem_down_write_slowpath+0xeeb/0x13b0 kernel/locking/rwsem.c:1178
 __down_write_common+0x1af/0x200 kernel/locking/rwsem.c:1306
 kernfs_remove_by_name_ns+0x7a/0x160 fs/kernfs/dir.c:1689
 remove_bind_files drivers/base/bus.c:601 [inline]
 bus_remove_driver+0x27b/0x320 drivers/base/bus.c:738
 usb_gadget_unregister_driver+0x4e/0x70 drivers/usb/gadget/udc/core.c:1733
 raw_release+0xf9/0x1e0 drivers/usb/gadget/legacy/raw_gadget.c:462
 __fput+0x406/0x8b0 fs/file_table.c:422
 __do_sys_close fs/open.c:1555 [inline]
 __se_sys_close fs/open.c:1540 [inline]
 __x64_sys_close+0x7f/0x110 fs/open.c:1540
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8d4775396a
RSP: 002b:00007ffc3a5ce880 EFLAGS: 00000293
 ORIG_RAX: 0000000000000003
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f8d4775396a
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007f8d47713770 R08: 7fffffffffffffff R09: 0000000000000000
R10: 00007ffc3a5ce8d0 R11: 0000000000000293 R12: 00007ffc3a5ce960
R13: 0000000000097397 R14: 00000000000973c9 R15: 00007ffc3a5ce8f0
 </TASK>
INFO: task syz-executor384:5385 blocked for more than 149 seconds.
      Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor384 state:D
 stack:26624 pid:5385  tgid:5385  ppid:5139   flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5408 [inline]
 __schedule+0x17e8/0x4a20 kernel/sched/core.c:6745
 __schedule_loop kernel/sched/core.c:6822 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6837
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894
 rwsem_down_write_slowpath+0xeeb/0x13b0 kernel/locking/rwsem.c:1178
 __down_write_common+0x1af/0x200 kernel/locking/rwsem.c:1306
 kernfs_remove_by_name_ns+0x7a/0x160 fs/kernfs/dir.c:1689
 remove_bind_files drivers/base/bus.c:600 [inline]
 bus_remove_driver+0x26c/0x320 drivers/base/bus.c:738
 usb_gadget_unregister_driver+0x4e/0x70 drivers/usb/gadget/udc/core.c:1733
 raw_release+0xf9/0x1e0 drivers/usb/gadget/legacy/raw_gadget.c:462
 __fput+0x406/0x8b0 fs/file_table.c:422
 __do_sys_close fs/open.c:1555 [inline]
 __se_sys_close fs/open.c:1540 [inline]
 __x64_sys_close+0x7f/0x110 fs/open.c:1540
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8d4775396a
RSP: 002b:00007ffc3a5ce880 EFLAGS: 00000293
 ORIG_RAX: 0000000000000003
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f8d4775396a
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007f8d47713770 R08: 7fffffffffffffff R09: 0000000000000000
R10: 00007ffc3a5ce8d0 R11: 0000000000000293 R12: 00007ffc3a5ce960
R13: 00000000000973cc R14: 00000000000973fe R15: 00007ffc3a5ce8f0
 </TASK>
INFO: task udevd:5389 blocked for more than 149 seconds.
      Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:udevd           state:D
 stack:26784 pid:5389  tgid:5389  ppid:4543   flags:0x00004002
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5408 [inline]
 __schedule+0x17e8/0x4a20 kernel/sched/core.c:6745
 __schedule_loop kernel/sched/core.c:6822 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6837
 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894
 rwsem_down_read_slowpath kernel/locking/rwsem.c:1086 [inline]
 __down_read_common kernel/locking/rwsem.c:1250 [inline]
 __down_read kernel/locking/rwsem.c:1263 [inline]
 down_read+0x705/0xa40 kernel/locking/rwsem.c:1528
 kernfs_dop_revalidate+0xd4/0x560 fs/kernfs/dir.c:1159
 lookup_fast+0x1f4/0x4a0
 walk_component fs/namei.c:2000 [inline]
 link_path_walk+0x60b/0xea0 fs/namei.c:2331
 path_openat+0x24a/0x3280 fs/namei.c:3803
 do_filp_open+0x235/0x490 fs/namei.c:3834
 do_sys_openat2+0x13e/0x1d0 fs/open.c:1405
 do_sys_open fs/open.c:1420 [inline]
 __do_sys_openat fs/open.c:1436 [inline]
 __se_sys_openat fs/open.c:1431 [inline]
 __x64_sys_openat+0x247/0x2a0 fs/open.c:1431
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f46cb1169a4
RSP: 002b:00007ffec0ae3f30 EFLAGS: 00000246
 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00007f46cb1169a4
RDX: 0000000000080000 RSI: 00007ffec0ae4068 RDI: 00000000ffffff9c
RBP: 00007ffec0ae4068 R08: 0000000000000008 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080000
R13: 000055f970a24b42 R14: 0000000000000001 R15: 000055f970a40160
 </TASK>

Showing all locks held in the system:
4 locks held by kworker/0:1/9:
 #0: 
ffff888015185148
 (
(wq_completion)usb_hub_wq
){+.+.}-{0:0}
, at: process_one_work kernel/workqueue.c:3206 [inline]
, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3312
 #1: 
ffffc900000e7d00
 (
(work_completion)(&hub->events)
){+.+.}-{0:0}
, at: process_one_work kernel/workqueue.c:3207 [inline]
, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3312

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/16 17:25 upstream 2ccbdf43d5e7 f429ab00 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce INFO: task hung in kernfs_add_one
2024/06/03 20:28 linux-next 861a3cb5a2a8 0aba2352 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root INFO: task hung in kernfs_add_one
2024/05/24 05:45 linux-next 124cfbcd6d18 8f98448e .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root INFO: task hung in kernfs_add_one
2024/06/16 11:31 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 5821bf2dffbe f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb INFO: task hung in kernfs_add_one
2024/06/09 23:37 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 5821bf2dffbe 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb INFO: task hung in kernfs_add_one
2024/06/07 14:41 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 5821bf2dffbe 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb INFO: task hung in kernfs_add_one
2024/05/30 23:38 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 1613e604df0c 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb INFO: task hung in kernfs_add_one
2024/05/27 06:30 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 6fbf71854e2d a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb INFO: task hung in kernfs_add_one
2024/05/22 05:31 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 51474ab44abf 1014eca7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb INFO: task hung in kernfs_add_one
* Struck through repros no longer work on HEAD.