syzbot


possible deadlock in fuse_reverse_inval_entry

Status: upstream: reported C repro on 2021/08/10 04:41
Reported-by: syzbot+37916bd093148488c883@syzkaller.appspotmail.com
First crash: 1049d, last: 657d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in fuse_reverse_inval_entry fuse C error 1 1021d 1047d 20/27 fixed on 2022/03/08 16:11
linux-4.19 possible deadlock in fuse_reverse_inval_entry C error 89 511d 1093d 0/1 upstream: reported C repro on 2021/06/27 09:34
Fix bisection attempts (14)
Created Duration User Patch Repo Result
2022/10/13 02:20 0m bisect fix linux-4.14.y error job log (0)
2022/09/06 13:16 30m bisect fix linux-4.14.y job log (0) log
2022/08/07 12:29 23m bisect fix linux-4.14.y job log (0) log
2022/07/08 12:08 20m bisect fix linux-4.14.y job log (0) log
2022/06/08 11:42 26m bisect fix linux-4.14.y job log (0) log
2022/05/09 11:04 27m bisect fix linux-4.14.y job log (0) log
2022/04/07 08:28 21m bisect fix linux-4.14.y job log (0) log
2022/03/08 08:03 25m bisect fix linux-4.14.y job log (0) log
2022/02/06 06:52 29m bisect fix linux-4.14.y job log (0) log
2022/01/07 06:27 24m bisect fix linux-4.14.y job log (0) log
2021/12/08 05:53 21m bisect fix linux-4.14.y job log (0) log
2021/11/08 05:28 23m bisect fix linux-4.14.y job log (0) log
2021/10/09 05:03 25m bisect fix linux-4.14.y job log (0) log
2021/09/09 04:40 22m bisect fix linux-4.14.y job log (0) log

Sample crash report:
============================================
WARNING: possible recursive locking detected
4.14.243-syzkaller #0 Not tainted
--------------------------------------------
syz-executor847/7985 is trying to acquire lock:
 (&type->i_mutex_dir_key#7){++++}, at: [<ffffffff822e2273>] inode_lock include/linux/fs.h:719 [inline]
 (&type->i_mutex_dir_key#7){++++}, at: [<ffffffff822e2273>] fuse_reverse_inval_entry+0x2a3/0x5e0 fs/fuse/dir.c:991

but task is already holding lock:
 (&type->i_mutex_dir_key#7){++++}, at: [<ffffffff822e2069>] inode_lock include/linux/fs.h:719 [inline]
 (&type->i_mutex_dir_key#7){++++}, at: [<ffffffff822e2069>] fuse_reverse_inval_entry+0x99/0x5e0 fs/fuse/dir.c:972

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

       CPU0
       ----
  lock(&type->i_mutex_dir_key#7);
  lock(&type->i_mutex_dir_key#7);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

2 locks held by syz-executor847/7985:
 #0:  (&fc->killsb){.+.+}, at: [<ffffffff822d6e67>] fuse_notify_delete fs/fuse/dev.c:1575 [inline]
 #0:  (&fc->killsb){.+.+}, at: [<ffffffff822d6e67>] fuse_notify fs/fuse/dev.c:1812 [inline]
 #0:  (&fc->killsb){.+.+}, at: [<ffffffff822d6e67>] fuse_dev_do_write+0x1ec7/0x25c0 fs/fuse/dev.c:1887
 #1:  (&type->i_mutex_dir_key#7){++++}, at: [<ffffffff822e2069>] inode_lock include/linux/fs.h:719 [inline]
 #1:  (&type->i_mutex_dir_key#7){++++}, at: [<ffffffff822e2069>] fuse_reverse_inval_entry+0x99/0x5e0 fs/fuse/dir.c:972

stack backtrace:
CPU: 0 PID: 7985 Comm: syz-executor847 Not tainted 4.14.243-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_deadlock_bug kernel/locking/lockdep.c:1800 [inline]
 check_deadlock kernel/locking/lockdep.c:1847 [inline]
 validate_chain kernel/locking/lockdep.c:2448 [inline]
 __lock_acquire.cold+0x180/0x97c kernel/locking/lockdep.c:3491
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
 down_write+0x34/0x90 kernel/locking/rwsem.c:54
 inode_lock include/linux/fs.h:719 [inline]
 fuse_reverse_inval_entry+0x2a3/0x5e0 fs/fuse/dir.c:991
 fuse_notify_delete fs/fuse/dev.c:1578 [inline]
 fuse_notify fs/fuse/dev.c:1812 [inline]
 fuse_dev_do_write+0x1f22/0x25c0 fs/fuse/dev.c:1887
 fuse_dev_write+0x125/0x1a0 fs/fuse/dev.c:1971
 call_write_iter include/linux/fs.h:1778 [inline]
 new_sync_write fs/read_write.c:469 [inline]
 __vfs_write+0x44c/0x630 fs/read_write.c:482
 vfs_write+0x17f/0x4d0 fs/read_write.c:544
 SYSC_write fs/read_write.c:590 [inline]
 SyS_write+0xf2/0x210 fs/read_write.c:582
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x4455e9
RSP: 002b:00007f89e31302f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000004ce4e0 RCX: 00000000004455e9
RDX: 000000000000002e RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 000000000049e0d4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049c0d0
R13: 65

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/08/10 04:40 linux-4.14.y 46914f96189b 6972b106 .config console log report syz C ci2-linux-4-14 possible deadlock in fuse_reverse_inval_entry
* Struck through repros no longer work on HEAD.