syzbot


possible deadlock in __configfs_open_file

Status: upstream: reported C repro on 2024/12/22 09:16
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+f6e8174215573a84b797@syzkaller.appspotmail.com
First crash: 62d, last: 32d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [fs?] possible deadlock in __configfs_open_file 0 (1) 2024/12/22 09:16
Last patch testing requests (4)
Created Duration User Patch Repo Result
2025/01/13 11:10 22m retest repro upstream report log
2025/01/13 11:10 22m retest repro upstream report log
2025/01/13 11:10 21m retest repro upstream report log
2025/01/13 11:10 13m retest repro upstream report log

Sample crash report:
============================================
WARNING: possible recursive locking detected
6.13.0-rc5-syzkaller #0 Not tainted
--------------------------------------------
syz-executor617/5827 is trying to acquire lock:
ffff888026d5a678 (&p->frag_sem){.+.+}-{4:4}, at: __configfs_open_file+0xe8/0x9c0 fs/configfs/file.c:304

but task is already holding lock:
ffff888026d5a678 (&p->frag_sem){.+.+}-{4:4}, at: flush_write_buffer fs/configfs/file.c:205 [inline]
ffff888026d5a678 (&p->frag_sem){.+.+}-{4:4}, at: configfs_write_iter+0x216/0x4b0 fs/configfs/file.c:229

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&p->frag_sem);
  lock(&p->frag_sem);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

4 locks held by syz-executor617/5827:
 #0: ffff888144af4420 (sb_writers#9){.+.+}-{0:0}, at: ksys_pwrite64 fs/read_write.c:786 [inline]
 #0: ffff888144af4420 (sb_writers#9){.+.+}-{0:0}, at: __do_sys_pwrite64 fs/read_write.c:794 [inline]
 #0: ffff888144af4420 (sb_writers#9){.+.+}-{0:0}, at: __se_sys_pwrite64 fs/read_write.c:791 [inline]
 #0: ffff888144af4420 (sb_writers#9){.+.+}-{0:0}, at: __x64_sys_pwrite64+0x1f6/0x250 fs/read_write.c:791
 #1: ffff8880249f1c88 (&buffer->mutex){+.+.}-{4:4}, at: configfs_write_iter+0x75/0x4b0 fs/configfs/file.c:226
 #2: ffff888026d5a678 (&p->frag_sem){.+.+}-{4:4}, at: flush_write_buffer fs/configfs/file.c:205 [inline]
 #2: ffff888026d5a678 (&p->frag_sem){.+.+}-{4:4}, at: configfs_write_iter+0x216/0x4b0 fs/configfs/file.c:229
 #3: ffffffff8ee08a88 (target_devices_lock){+.+.}-{4:4}, at: target_core_item_dbroot_store+0x23/0x2e0 drivers/target/target_core_configfs.c:114

stack backtrace:
CPU: 0 UID: 0 PID: 5827 Comm: syz-executor617 Not tainted 6.13.0-rc5-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
 print_deadlock_bug+0x2e3/0x410 kernel/locking/lockdep.c:3037
 check_deadlock kernel/locking/lockdep.c:3089 [inline]
 validate_chain kernel/locking/lockdep.c:3891 [inline]
 __lock_acquire+0x2117/0x3c40 kernel/locking/lockdep.c:5226
 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849
 down_read+0x9a/0x330 kernel/locking/rwsem.c:1524
 __configfs_open_file+0xe8/0x9c0 fs/configfs/file.c:304
 do_dentry_open+0xf59/0x1ea0 fs/open.c:945
 vfs_open+0x82/0x3f0 fs/open.c:1075
 do_open fs/namei.c:3828 [inline]
 path_openat+0x1e6a/0x2d60 fs/namei.c:3987
 do_filp_open+0x20c/0x470 fs/namei.c:4014
 file_open_name+0x2a4/0x450 fs/open.c:1347
 filp_open+0x4b/0x80 fs/open.c:1367
 target_core_item_dbroot_store+0x10d/0x2e0 drivers/target/target_core_configfs.c:134
 flush_write_buffer fs/configfs/file.c:207 [inline]
 configfs_write_iter+0x2f6/0x4b0 fs/configfs/file.c:229
 new_sync_write fs/read_write.c:586 [inline]
 vfs_write+0x5ae/0x1150 fs/read_write.c:679
 ksys_pwrite64 fs/read_write.c:786 [inline]
 __do_sys_pwrite64 fs/read_write.c:794 [inline]
 __se_sys_pwrite64 fs/read_write.c:791 [inline]
 __x64_sys_pwrite64+0x1f6/0x250 fs/read_write.c:791
 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:0x7f67949c02e9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe65528488 EFLAGS: 00000246 ORIG_RAX: 0000000000000012
RAX: ffffffffffffffda RBX: 00007ffe65528658 RCX: 00007f67949c02e9
RDX: 0000000000000200 RSI: 0000000020000000 RDI: 0000000000000003
RBP: 00007f6794a33610 R08: 0000000000000000 R09: 00007ffe65528658
R10: 0000000000000009 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe65528648 R14: 0000000000000001 R15: 000000000

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/30 10:31 upstream fc033cf25e61 d3ccff63 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
2024/12/24 22:13 upstream 9b2ffa6148b1 444551c4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
2024/12/19 17:41 upstream eabcdba3ad40 1d58202c .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
2024/12/18 09:34 upstream aef25be35d23 a0626d3a .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
2025/01/17 14:25 upstream 9bffa1ad25b8 bb91bdd4 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
2025/01/17 14:25 upstream 9bffa1ad25b8 bb91bdd4 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
2025/01/14 04:55 upstream c45323b7560e b1f1cd88 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
2024/12/30 06:49 upstream 4099a71718b0 d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
2024/12/30 03:22 upstream 4099a71718b0 d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
2024/12/19 12:36 upstream eabcdba3ad40 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
2024/12/18 09:10 upstream aef25be35d23 a0626d3a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in __configfs_open_file
* Struck through repros no longer work on HEAD.